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
File details
Details for the file opentelemetry-instrumentation-django-0.14b0.tar.gz
.
File metadata
- Download URL: opentelemetry-instrumentation-django-0.14b0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c96ef9e65da0c81dcc1445360dd5f074ddd033093641b8e1d7b314409207440 |
|
MD5 | 476903ce4849cfd7bd572926c164906f |
|
BLAKE2b-256 | 0ae46be68a5a57730e85e18bcd7d60e9e81fa8458c2ebe7ecc99156a2118546f |
File details
Details for the file opentelemetry_instrumentation_django-0.14b0-py3-none-any.whl
.
File metadata
- Download URL: opentelemetry_instrumentation_django-0.14b0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3db73f75403a54c3ec78898c3e3c3c5d7c54a2b34d2d6b634bbe0e2f5d7430e3 |
|
MD5 | bfddb1ea8348c77c508abf118295cc1f |
|
BLAKE2b-256 | 209485da906f3f4fbf2ab31547c72cc951fde59400e80fecdab34d97b756932a |