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.15b0.tar.gz
.
File metadata
- Download URL: opentelemetry-instrumentation-django-0.15b0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87e1eed3b98ac1fe6bf5c44a5739db77b5bbbb4f4c7c59dad845fa9aacad1774 |
|
MD5 | 17aa6bedc8fc06b4ad4b7d3ba2baaf0c |
|
BLAKE2b-256 | 510bd6b5afc314e71788a9afb98f3648cb0eda32ca6385c260a30b4237f89f64 |
Provenance
File details
Details for the file opentelemetry_instrumentation_django-0.15b0-py3-none-any.whl
.
File metadata
- Download URL: opentelemetry_instrumentation_django-0.15b0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e25fe9aaa6cfcedde660ca6e4268fe183ff5fc694bc78591dcfbd85473073a94 |
|
MD5 | 4209afab8f93068bd59aa136357be0bc |
|
BLAKE2b-256 | 3d8ca06ee0c88b19c141f669714d70b5dceee446d68c92b4453e715a3c2a9e33 |