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.17b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdb926da1bcde574c664a20674dd8b252ee8c6281dd76058393cd67d404cffc6 |
|
MD5 | deb486e5172129518c71742ba9b18e8a |
|
BLAKE2b-256 | d8b6321f274477618afbc4e59b4185758a3e15f611e1a0080d99d8c961d450bb |
Hashes for opentelemetry_instrumentation_django-0.17b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25d1d872c6b2bef899d27e85b11f37628d2d671a51675599fca96fe108c2e23f |
|
MD5 | 242b566b8245f391b52a739e93c5d51e |
|
BLAKE2b-256 | 126cfbdd323a4e68fb4cb3da25d0aaac3b637d916fde8c538fa063548b4f7d7e |