Hello World Telemetry
Running Telemetry using Sentry + Open Telemetry
git clone https://github.com/GDP-ADMIN/bosa-example-apps.git
cd bosa-telemetry-sentry-example-apps▶️ Execute the script for installing and start the dependencies
./start-dependencies.shThis script will do the following:
Installing dependencies
🚀 Then run the app
poetry run python bosa_telemetry_sentry_example_app/main.py🌐 After the app is running, try to hit the endpoints like curl http://127.0.0.1:8000 or curl http://127.0.0.1:8000/test-telemetry
this is the expected output
INFO: 127.0.0.1:34038 - "GET / HTTP/1.1" 200 OK {"message":"Application running with Sentry + OpenTelemetry.","telemetry_mode":"Sentry with OpenTelemetry","environment":"development"}
INFO: 127.0.0.1:34052 - "GET /test-telemetry HTTP/1.1" 200 OK {"message":"Telemetry test endpoint called.","using_opentelemetry":true,"check":"Check your Sentry dashboard for traces."}
The key indicators of success:
There will be trace in your sentry dashboard (notes: you will need access for the dashboard)
this is the snippet example how to initialize your code for using this:
In the example you can init OpenTelemetryConfig ,SentryConfig ,TelemetryConfig. after you finisht hat you just need to call init_telemetry
How to setup your own DSN
Set up your SENTRY_DSN in .env file
SENTRY_DSN in .env filethis is the example of .env file (or you can see in the repository in .env.example)
Example how to add another instrumentation
This is the example if you want to add more instrumentation in your code, for example how to add instrumentation with HTTPX
install the dependencies open telemetry instrumentation https
Initiliaze the instrumentation
This is the list of instrumentation supported by open telemetry SDK: open telemetry instrumentation list
Last updated