Python application that sends a stream of test log data to PostHog using OTLP over HTTP.
- Python 3.7+
- PostHog instance with OTLP endpoint
- Create a virtual environment:
python -m venv .venv
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Create a
.envfile with your PostHog API key:
POSTHOG_API_KEY=your_api_key_here
Run the application:
python main.pyThe script will continuously send log messages every second.
By default, logs are sent to http://localhost:4318/v1/logs. You can modify the endpoint in main.py if needed.