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

File metadata

  • Download URL: opentelemetry-instrumentation-django-0.16b0.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.16b0.tar.gz
Algorithm Hash digest
SHA256 7b8903223d0febbde7977de8f330921ab0311fd84dc85be0e6b9f7824ed06d80
MD5 c4ccb76dad7b3ed1a53b047863f535d8
BLAKE2b-256 b72112f78f3d4bb883fde253f8019e53a2a310a57a5bbcf4524c094e54a1de84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_django-0.16b0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0b2c58050be75ba5ae8e5d7a940c7b4a6a4912628492a137556b9e94aebcfb0
MD5 081814b5df5a32c2f23aa27c573ff883
BLAKE2b-256 e3043c3eb12659a9f440c6a13b850a64f8b90d297140de2c83ec72fe94a05ecb

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