OpenTelemetry Instrumentation for Django
Project description
This library allows tracing requests for Django applications.
Installation
pip install opentelemetry-instrumentation-django
Configuration
Exclude lists
To exclude certain URLs from being tracked, set the environment variable OTEL_PYTHON_DJANGO_EXCLUDED_URLS with comma delimited regexes representing which URLs to exclude.
For example,
export OTEL_PYTHON_DJANGO_EXCLUDED_URLS="client/.*/info,healthcheck"
will exclude requests such as https://site/client/123/info and https://site/xyz/healthcheck.
Request attributes
To extract certain attributes from Django’s request object and use them as span attributes, set the environment variable OTEL_PYTHON_DJANGO_TRACED_REQUEST_ATTRS to a comma delimited list of request attribute names.
For example,
export OTEL_PYTHON_DJANGO_TRACED_REQUEST_ATTRS='path_info,content_type'
will extract path_info and content_type attributes from every traced request and add them as span attritbues.
Django Request object reference: https://docs.djangoproject.com/en/3.1/ref/request-response/#attributes
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for opentelemetry-instrumentation-django-0.16b1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40aaade39441ed3b57d22ef4aef371ee4026341c8eadff0f443646693b3111ce |
|
MD5 | ec7c9d60fce824a0eb5fea2f8fc0459e |
|
BLAKE2b-256 | 0d957b793aade88cd1ecca41888f918e52ec87e221c715f886f64867ec6350dc |
Hashes for opentelemetry_instrumentation_django-0.16b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f6f62bae01752a88950c93dbb217bcb67659f9f3d5e22de514670e6ef993f24 |
|
MD5 | 3f9d419a2b169201a41fa90b77168306 |
|
BLAKE2b-256 | ed24fc85069b23ee4f30eecbbf04fc92d410f616eb0715516d1f60e4dae5d248 |