NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #486 most downloaded on PyPI
Datadog APM client library
Latest stable
4.17.2
Last release 3 days ago
19 Nov 2026
Ships on a steady schedule
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
5 versions withdrawn
withdrawn after publishing
10 years old
871 releases · first in 2017
Drag across the ruler to compare, or tap a release to open it.
Fix error when calling concurrent.futures.ThreadPoolExecutor.submit with fn keyword argument.
concurrent.futures.ThreadPoolExecutor.submit with fn keyword argument.The aredis integration is now enabled by default.
monkey.py have been moved into _monkey.py in an effort to internalize the module. Public methods have been imported back into monkey.py in order to retain compatibility, but monkey.py will be removed entirely in version 1.0.0.ddtrace.utils module and all of its submodules have been copied over into ddtrace.internal in an effort to internalize these modules. Their public counterparts will be removed entirely in version 1.0.0.botocore env variables to ensure they are parsed as booleans.Your coding agent can read these notes before it upgrades. Set up the MCP server →
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fixes parsing of botocore env variables to ensure they are parsed as booleans.
botocore env variables to ensure they are parsed as booleans.Fix memory leak caused when the tracer is disabled.
Set the correct package name in the Pyramid instrumentation. This should fix an issue where the incorrect package name was being used which would cras
Fix Pyramid caller_package level issue which resulted in crashes when starting Pyramid applications. Level now left at default (2).
Deprecate DATADOG_TRACE_AGENT_HOSTNAME, DATADOG_TRACE_AGENT_PORT, DATADOG_PRIORITY_SAMPLING, DATADOG_PATCH_MODULES in favor of their DD equivalents.
ddtrace.ext.errors. Use constants from ddtrace.constants module. For example: ddtrace.ext.errors.ERROR_MSG -> ddtrace.constants.ERROR_MSGddtrace.ext.priority. Use constants from ddtrace.constants module. For Example:: ddtrace.ext.priority.AUTO_KEEP -> ddtrace.constants.AUTO_KEEPddtrace.ext.system. Use constants from ddtrace.constants module. For Example:: ddtrace.ext.system.PID -> ddtrace.constants.PIDDeprecate DATADOG_TRACE_AGENT_HOSTNAME, DATADOG_TRACE_AGENT_PORT, DATADOG_PRIORITY_SAMPLING, DATADOG_PATCH_MODULES in favor of their DD equivalents.
[Deprecated environment variable] | [Recommended environment variable]
DATADOG_TRACE_AGENT_HOSTNAME, use DD_AGENT_HOSTDATADOG_TRACE_AGENT_PORT use DD_AGENT_PORTDATADOG_PRIORITY_SAMPLING, follow ingestion controlsDATADOG_PATCH_MODULES, use DD_PATCH_MODULESMoved ddtrace.ext.errors constants into the ddtrace.constants module. ddtrace.ext.errors will be removed in v1.0. Shorthand error constant (MSG,TYPE,STACK) in ddtrace.ext.errors will be removed in v1.0. Function get_traceback() in ddtrace.ext.errors is now deprecated and will be removed v1.0.
Moved ddtrace.ext.priority constants into ddtrace.constants module.
Moved ddtrace.ext.system constants into ddtrace.constants module.
/var/run/datadog/dsd.socket which if exists, will be used instead of the previous UDP default, udp://localhost:8125/. To be used in conjunction with dogstatsd_socket in your datadog.yaml file, or the DD_DOGSTATSD_SOCKET environment variable set on the Datadog agent.DD_TRACE_SAMPLING_RULES environment variable to override default sampling rules. For Example:: DD_TRACE_SAMPLING_RULES='[{"sample_rate":0.5,"service":"my-service"}]'pytest integration): include pytest version as a tag in the test span.pytest integration): Extract stage and job name from environment data in Azure Pipelines.DD_LOGS_INJECTION is enabled.ddtrace.utils.wrappers.unwrap function now raises an error if trying to unwrap a non-wrapped object.pytest integration): Fix extraction of branch in GitLab CI.Nothing published for this version
Nothing published for this version
Fixed an issue with gevent worker processes that caused them to crash and stop.
DD_LOGS_INJECTION is enabled.Deprecate the DATADOG_ENV environment variable in favor of DD_ENV. The use of DD_ENV should follow Unified Service Tagging recommendations.
/var/run/datadog/apm.socket which if exists, will be used instead of the previous http default, http://localhost:8126/. To be used in conjunction with apm_config.receiver_socket in your datadog.yaml file, or the DD_APM_RECEIVER_SOCKET environment variable set on the Datadog agent.DD_PROFILING_ENDPOINT_COLLECTION_ENABLED env variable to disable endpoint name collection in profiler.DD_TRACE_HEADER_TAGS environment variable. Value must be either comma or space separated. e.g. Host:http.host,User-Agent,http.user_agent or referer:http.referer Content-Type:http.content_type.test.status tag of a test span from pytest would be missing because pytest_runtest_makereport hook is not run, like when pytest has an internal error.protobuf version to <3.18 for Python <=3.5 due to support being dropped.Nothing published for this version
Fixes an issue where all Django function middleware will share the same resource name.
Fix the reporting of the allocated memory and the number of allocations in the profiler.
Fixed the support for Celery workers that fork sub-processes with Python 3.6 and earlier versions.
test.status tag of a test span from pytest would be missing because pytest_runtest_makereport hook is not run, like when pytest has an internal error.protobuf version to <3.18 for Python <=3.5 due to support being dropped.Pin setup_requires dependency setuptools_scm[toml]>=4,<6.1 to avoid breaking changes.
ddtrace.Tracer.get_log_correlation_context method has been added to replace ddtrace.helpers.get_correlation_ids. It now returns a dictionary which includes the current span's trace and span ids, as well as the configured service, version, and environment names.django.request span resource would get overwritten by the integration.setup_requires dependency setuptools_scm[toml]>=4,<6.1 to avoid breaking changes.Nothing published for this version
Nothing published for this version
Pin protobuf version to <3.18 for Python \<=3.5 due to support being dropped.
protobuf version to <3.18 for Python <=3.5 due to support being dropped.Pin setup_requires dependency setuptools_scm[toml]>=4,<6.1 to avoid breaking changes.
setup_requires dependency setuptools_scm[toml]>=4,<6.1 to avoid breaking changes.Removed the collect_metrics argument from Tracer.configure. See the release notes for v0.49.0 for the migration instructions.
collect_metrics argument from Tracer.configure. See the release notes for v0.49.0 for the migration instructions.Add tracing support for the httpx library. Supported versions >=0.14.0.
ASGI: store the ASGI span in the scope. The span can be retrieved with the
ddtrace.contrib.asgi.span_from_scope function.
Submit runtime metrics as distribution metrics instead of gauge metrics.
Support flask-caching (>= 1.10.0) with the Flask-Cache tracer.
Only for CI Visibility (<span class="title-ref">pytest</span> integration): It is now possible to specify any of the following git metadata through environment variables:
ASGI: handle decoding errors when extracting headers for trace propagation.
Corrected some typing annotations for PEP 484 compliance
Django: add support for version 3.1+ ASGI applications. A different codepath is taken for requests starting in Django 3.1 which led to the top level span not being generated for requests. The fix introduces automatic installation of the ASGI middleware to trace Django requests.
dogpile.cache: handle both kwargs and args in the wrapper functions (using only kwargs would result in an IndexError.
Fixes an issue with the Django integration where if the urlconf changes at any point during the handling of the request then the resource name will only be <METHOD> 404. This fix moves resource name resolution to the end of the request.
Fixes error with tagging non-string Flask view args.
werkzeug.exceptions.NotFound 404 errors are no longer raised and logged as a server error in the Flask integration.
Fixes type hinting for **patch_modules parameter for patch/patch_all functions.
Fixes an issue when using the pytest plugin with doctest which raises an AttributeError on DoctestItem.
Fixes a bug in the pytest plugin where xfail test cases in a test file with a module-wide skip raises attribute errors and are marked as xfail rather than skipped.
Fixed the handling of sanic endpoint paths with non-string arguments.
opentracer: don't override default tracing config for the <span class="title-ref">ENABLED</span>, <span class="title-ref">AGENT_HOSTNAME</span>, <span class="title-ref">AGENT_HTTPS</span> or <span class="title-ref">AGENT_PORT</span> settings.
Nothing published for this version
Nothing published for this version
Pin setup_requires dependency setuptools_scm[toml]>=4,<6.1 to avoid breaking changes.
setup_requires dependency setuptools_scm[toml]>=4,<6.1 to avoid breaking changes.ASGI: store the ASGI span in the scope. The span can be retrieved with the ddtrace.contrib.asgi.span_from_scope function.
ddtrace.contrib.asgi.span_from_scope function.**patch_modules parameter for patch/patch_all functions.Nothing published for this version
The legacy Django configuration method (deprecated in 0.34) has been removed.
monkey.patch_module is deprecated.monkey.get_patch_module is deprecated.jinja2~=3.0.0.aiopg~=0.16.0.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fixes a bug in the pytest plugin where xfail test cases in a test file with a module-wide skip raises attribute errors and are marked as xfail rather
Fixed the handling of sanic endpoint paths with non-string arguments.
Fixed JSON encoding errors in the pytest plugin for parameterized tests with dictionary parameters with tuple keys. The pytest plugin now always JSON
Fixed JSON encoding errors in the pytest plugin for parameterized tests with complex Python object parameters. The pytest plugin now defaults to encod
The reuse of a tracer that has been shut down has been deprecated. A new tracer should be created for generating new traces.
Major changes to context management. See the upgrade section for the specifics. Note that only advanced users of the library should be affected by these changes. For the details please refer to the Context section of the docs: https://ddtrace.readthedocs.io/en/v0.50.0/advanced_usage.html
ddtrace.contrib.asyncio
AsyncioContextProvider can now return and activate None, Span or Context objects.ddtrace.contrib.gevent
GeventContextProvider can now return and activate None, Span or Context objects.ddtrace.contrib.tornado
TracerStackContext can now return and activate None, Span or Context objects.ddtrace.context.Context no longer maintains the active/current span state.
get_current_root_span() has been removed. Use tracer.current_root_span() instead. get_current_span() has been removed. Use tracer.current_span() instead. add_span() has been removed. To activate a span in an execution use tracer.context_provider.activate() instead. close_span() has been removed. To deactivate a span in an execution use tracer.context_provider.activate() instead.
ddtrace.provider.BaseContextProvider active() now returns None, Span or Context objects. activate() now accepts None, Span or Context objects.
ddtrace.span.Span
Span.context will now return a Contextddtrace.tracer.Tracer tracer.get_call_context() will now return a one-off Context reference. This is to maintain backwards compatibility with the API but the functionality differs slightly. tracer.start_span() passing a span.context for child_of no longer adds the strong _parent reference to the new span.
Support for MySQL-python has been removed.
Support for psycopg < 2.7 has been removed.
Add DD_CALL_BASIC_CONFIG={true,false} environment variable to control whether ddtrace calls logging.basicConfig. By default when using ddtrace-run or running in debug mode logging.basicConfig is called to ensure there is always a root handler. This has compatibility issues for some logging configurations. DD_CALL_BASIC_CONFIG=false can be used to skip calling logging.basicConfig. The default value is true to maintain existing behavior.
agent: support URL with a base path
Automated context management should now work in all asynchronous frameworks that use contextvars.
tracer.start_span() now accepts an activate argument (default False) to allow manual context management.
tracer.current_trace_context() has been added to be used to access the trace context of the active trace.
A warning has been added to alert when gevent monkey patching is done after ddtrace has been imported.
Add support for Flask 2
Added retry logic to the tracer to mitigate potential networking issues, like timeouts or dropped connections.
Add new DD_TRACE_AGENT_TIMEOUT_SECONDS to override the default connection timeout used when sending data to the trace agent. The default is 2.0 seconds.
The CI tagging for the pytest plugin now includes OS and Python Runtime metadata including system architecture, platform, version, and Python runtime name and version.
Add new environment variables to configure the internal trace writer.
DD_TRACE_WRITER_MAX_BUFFER_SIZE, DD_TRACE_WRITER_INTERVAL_SECONDS, DD_TRACE_WRITER_MAX_PAYLOAD_SIZE_BYTES
The exception profiler now gathers and exports the traces and spans information.
The pytest plugin now includes support for automatically tagging spans with parameters in parameterized tests.
The Python heap profiler can now be enabled by setting the DD_PROFILING_HEAP_ENABLED environment variable to 1.
The OpenTracing tracer.start_span method no longer activates spans.
Datadog active spans will no longer take precedence over OpenTracing active spans.
django: fix a bug where multiple database backends would not be instrumented.
django: fix a bug when postgres query is composable sql object.
A possible memory leak that occurs when tracing across a fork has been fixed. See https://github.com/DataDog/dd-trace-py/pull/2497 for more information.
Fix double patching of pymongo client topology.
The shutdown task is re-registered when a tracer is reused after it has been shut down.
Fixed the optional argument of Span.finish to Optional[float] instead of Optional[int].
Fixed the handling of the Django template name tag causing type errors.
Fixes an issue when trying to manually start the runtime metrics worker:
AttributeError: module 'ddtrace.internal.runtime' has no attribute 'runtime_metrics'
sanic: update instrumentation to support version 21.
Performance of the Celery integration has been improved.
Fix runtime-id and system.pid tags not being set on distributed traces.
Body from the set of span tags.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fixes an issue when trying to manually start the runtime metrics worker:
Fixes an issue when trying to manually start the runtime metrics worker:
AttributeError: module 'ddtrace.internal.runtime' has no attribute 'runtime_metrics'
Fixes an issue with enabling the runtime worker introduced in v0.49.0 where no runtime metrics were sent to the agent.
django: fix a bug where multiple database backends would not be instrumented.
Fix double patching of pymongo client topology.
pymongo client topology.### New Features - Add support for Flask 2 ---
Several deprecations have been made to Context as we prepare to move active span management out of this class.
Several deprecations have been made to Context as we prepare to move active span management out of this class.
Support for aiohttp previous to 2.0 has been removed.
Support for deprecated <span class="title-ref">DD_PROFILING_API_URL</span> environment variable has been removed. Use <span class="title-ref">DD_SITE</span> instead.
Support for deprecated <span class="title-ref">DD_PROFILING_API_KEY</span> environment variable has been removed. Use <span class="title-ref">DD_API_KEY</span> instead.
Profiling support for agentless mode must now be explicitly enabled.
The ddtrace pytest plugin can now label spans from test cases marked xfail with the tag "pytest.result" and the reason for being marked xfail under the tag "pytest.xfail.reason".
Removed <span class="title-ref">ddtrace.ext.AppTypes</span> and its usages in the tracer library.
requests: spans will no longer inherit the service name from the parent.
The return value of Span.pprint() has been changed to a single line in the tracer debug logs rather than the previous custom multiline format.
Spans are now processed per tracer instance. Formerly spans were stored per-Context which could be shared between tracer instances. Note that context management is not affected. Tracers will still share active spans.
Spans from asynchronous executions (asyncio, gevent, tornado) will now be processed and flushed together. Formerly the spans were handled per-task.
tracer.write() will no longer have filters applied to the spans passed to it.
The function ddtrace.utils.merge_dicts has been removed.
Context.clone is deprecated. It will not be required in 0.50.
Context.add_span is deprecated and will be removed in 0.50.
Context.add_span is deprecated and will be removed in 0.50.
Context.close_span is deprecated and will be removed in 0.50.
Context.get_current_span is deprecated and will be removed in 0.50 please use <span class="title-ref">Tracer.current_span</span> instead.
Context.get_current_root_span is deprecated and will be removed in 0.50 please use Tracer.current_root_span instead.
Deprecate the configuration of the analytics through the generic dbapi2 configuration. This should now be configured via integration configurations, for example:
# Before
export DD_TRACE_DBAPI2_ANALYTICS_ENABLED=1
# After
export DD_TRACE_SQLITE3_ANALYTICS_ENABLED=1
<span class="title-ref">ddtrace.compat</span> has been deprecated and will be removed from the public API in ddtrace version 1.0.0.
Deprecate <span class="title-ref">ddtrace.config.dbapi2</span> as default for <span class="title-ref">TracedCursor</span> and <span class="title-ref">TracedConnection</span> as well as <span class="title-ref">DD_DBAPI2_TRACE_FETCH_METHODS</span>. Use <span class="title-ref">IntegrationConfig</span> and <span class="title-ref">DD_<INTEGRATION>_TRACE_FETCH_METHODS</span> specific to each dbapi-compliant library. For example:
# Before
config.dbapi2.trace_fetch_methods = True
# After
config.psycopg2.trace_fetch_methods = True
The use of ddtrace.encoding has been deprecated and will be removed in version 1.0.0.
The <span class="title-ref">ddtrace.http</span> module has been deprecated and will be removed in version 1.0.0, with the <span class="title-ref">ddtrace.http.headers</span> module now merged into <span class="title-ref">ddtrace.trace_utils</span>.
The collect_metrics argument of the tracer.configure method has been deprecated. Runtime metrics should be enabled only via the DD_RUNTIME_METRICS_ENABLED environment variable.
ddtrace.config.requests['service'] or the DD_REQUESTS_SERVICE environment variable.<stdint.h> was not available. This change also ensures we build and publish cp27-win wheels.logging.StrFormatStyle (logging.Formatter(fmt, style="{")) log formatter.urllib3 patching not properly activating the integration.pymemcache.client.hash.HashClient.gevent worker class has been added.pymemcache test suite to test latest versions.ddtrace.payload submodule has been removed.Nothing published for this version
Nothing published for this version
grpc: handle None values for span tags.
grpc: handle no package in fully qualified method
The default agent timeout for profiling has been restored from 2 to 10 seconds to avoid too many profiles from being dropped.
One column per quarter.