Skip to main content

OpenTelemetry Instrumentation for Django

Project description

pypi

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.16b1.tar.gz.

File metadata

  • Download URL: opentelemetry-instrumentation-django-0.16b1.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.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.7.9

File hashes

Hashes for opentelemetry-instrumentation-django-0.16b1.tar.gz
Algorithm Hash digest
SHA256 40aaade39441ed3b57d22ef4aef371ee4026341c8eadff0f443646693b3111ce
MD5 ec7c9d60fce824a0eb5fea2f8fc0459e
BLAKE2b-256 0d957b793aade88cd1ecca41888f918e52ec87e221c715f886f64867ec6350dc

See more details on using hashes here.

File details

Details for the file opentelemetry_instrumentation_django-0.16b1-py3-none-any.whl.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_django-0.16b1-py3-none-any.whl
Algorithm Hash digest
SHA256 9f6f62bae01752a88950c93dbb217bcb67659f9f3d5e22de514670e6ef993f24
MD5 3f9d419a2b169201a41fa90b77168306
BLAKE2b-256 ed24fc85069b23ee4f30eecbbf04fc92d410f616eb0715516d1f60e4dae5d248

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page