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.17b0.tar.gz.

File metadata

  • Download URL: opentelemetry-instrumentation-django-0.17b0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for opentelemetry-instrumentation-django-0.17b0.tar.gz
Algorithm Hash digest
SHA256 cdb926da1bcde574c664a20674dd8b252ee8c6281dd76058393cd67d404cffc6
MD5 deb486e5172129518c71742ba9b18e8a
BLAKE2b-256 d8b6321f274477618afbc4e59b4185758a3e15f611e1a0080d99d8c961d450bb

See more details on using hashes here.

File details

Details for the file opentelemetry_instrumentation_django-0.17b0-py3-none-any.whl.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_django-0.17b0-py3-none-any.whl
Algorithm Hash digest
SHA256 25d1d872c6b2bef899d27e85b11f37628d2d671a51675599fca96fe108c2e23f
MD5 242b566b8245f391b52a739e93c5d51e
BLAKE2b-256 126cfbdd323a4e68fb4cb3da25d0aaac3b637d916fde8c538fa063548b4f7d7e

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