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.14b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c96ef9e65da0c81dcc1445360dd5f074ddd033093641b8e1d7b314409207440 |
|
MD5 | 476903ce4849cfd7bd572926c164906f |
|
BLAKE2b-256 | 0ae46be68a5a57730e85e18bcd7d60e9e81fa8458c2ebe7ecc99156a2118546f |
Hashes for opentelemetry_instrumentation_django-0.14b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3db73f75403a54c3ec78898c3e3c3c5d7c54a2b34d2d6b634bbe0e2f5d7430e3 |
|
MD5 | bfddb1ea8348c77c508abf118295cc1f |
|
BLAKE2b-256 | 209485da906f3f4fbf2ab31547c72cc951fde59400e80fecdab34d97b756932a |