Django
Send traces to Last9 from a Django app using OpenTelemetry
Django is a high-level Python web framework that simplifies the development of secure and maintainable web applications. This comprehensive guide will help you instrument your Django application with OpenTelemetry and smoothly send the traces to a Last9 cluster. You can also check out the example application on GitHub↗.
Pre-requisites
- You have a Django application
- You have signed up for Last9, created a cluster, and obtained the following OTLP credentials from the Integrations page:
endpoint
auth_header
Install OpenTelemetry packages
To install the required packages, run the following command:
After, installing the required packages, run the following command to install the required instrumentation packages:
Set the environment variables
Now, that you’ve installed all the packages. Run the following command to initialize environment variables:
Note: Replace
<BASIC_AUTH_HEADER>
with the URL encoded value of the basic auth header.
Run the application
After setting the environment variables, run the Django application:
Visualize data
After running the Django app, you can visualize the traces in the Last9’s APM dashboard: Link
Troubleshooting
Please get in touch with us on Discord or Email if you have any questions.