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.19b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97996f89f2d7c3f3886b87435dc6330dd7b569c1bae29a96e31663a15b850dc1 |
|
MD5 | c45d3f13db535c81f6ebc8fd6fec0487 |
|
BLAKE2b-256 | 5118dddf50762677594b9a0c633e2ed8e5aa9b8f876f1ea29aa7def359258cd0 |
Hashes for opentelemetry_instrumentation_django-0.19b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b06c1f6e051ba0ec9b3ee56d8677866bb0871607a334f3a4d1ef312718191fa3 |
|
MD5 | f43eb023572e357f760bb07e4745e39c |
|
BLAKE2b-256 | e08142fc0df77bf5092ab1f58cf7b687d759dead61cdc4a0555b3d645446723c |