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.18b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fda3483f0bdfd09855cfd74eb67c5a39a7b91a7fae14d739c6b1b56fdca61963 |
|
MD5 | 147823d57cc44b79cf1aa35b09fb0c78 |
|
BLAKE2b-256 | a0e12cce1a70d09fc30faabb515b4e53bd7175049dc86da9aaa2eab81ed9a73a |
Hashes for opentelemetry_instrumentation_django-0.18b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a256a3c711fb1d020d7a48b8f1ff39e839020431c791207a33cd6153cdacb5b5 |
|
MD5 | 4252d6ea88df6ddd3bee9c061c065f0f |
|
BLAKE2b-256 | 21470672e9e1c8c5b4c78e1183392a3fd0a7cb86a14e3c40d0e59892bf354320 |