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.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Before upgrading to v2.0.0, we recommend users install ddtrace~=1.20.0 and enable deprecation warnings. All removals to the library interface and envi…
Your coding agent can read these notes before it upgrades. Set up the MCP server →
The Datadog APM Python team is happy to announce the release of v2.0.0 of ddtrace. This release drops support for Python 2.7, 3.5, and 3.6. This release adds support for Python 3.12.
<div class="important">
<div class="title">
Important
</div>
If you are on version of Python not supported by v2, we will continue to maintain the ddtrace v1 with bug fixes.
</div>
<div class="note">
<div class="title">
Note
</div>
Before upgrading to v2.0.0, we recommend users install ddtrace~=1.20.0 and enable deprecation warnings. All removals to the library interface and environment variables in v2 were deprecated in the 1.x release line.
</div>
<div class="note">
<div class="title">
Note
</div>
The changes to environment variables apply only to the configuration of the ddtrace library and not the Datadog Agent.
</div>
The default logging configuration functionality of ddtrace has been changed to avoid conflicting with application logging configurations. DD_CALL_BASIC_CONFIG has been removed and the ddtrace logger will log to stdout by default, or a log file as specified using DD_TRACE_LOG_FILE.
Setting the environment variable DD_TRACE_PROPAGATION_STYLE='b3', which previously enabled b3multi now enables b3 single header. b3 single header still works but is deprecated for b3. Simplified: b3 used to enable b3multi, but now enables b3 single header to better align with Opentelemetry's terms.
These environment variables have been removed. In all cases the same functionality is provided by other environment variables and replacements are provided as recommended actions for upgrading.
| Variable | Replacement | Note |
|---|---|---|
DD_GEVENT_PATCH_ALL |
None | 📝<remove-dd-gevent-patch-all> |
DD_AWS_TAG_ALL_PARAMS |
None | 📝<remove-aws-tag-all-params> |
DD_REMOTECONFIG_POLL_SECONDS |
DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS |
📝<rename-remote-config-poll-seconds> |
DD_CALL_BASIC_CONFIG |
None | 📝<remove-basic-config> |
DD_TRACE_OBFUSCATION_QUERY_STRING_PATERN |
DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP |
📝<remove-trace-obfuscation-query-string-pattern> |
These methods and module attributes have been removed. Where the same functionality is provided by a different public method or module attribute, a recommended action is provided for upgrading. In a few limited cases, because the interface was no longer used or had been moved to the internal interface, it was removed and so no action is provided for upgrading.
| Module | Method/Attribute | Note |
|---|---|---|
ddtrace.constants |
APPSEC_ENABLED |
📝<remove-appsec-private-constants> |
APPSEC_JSON |
📝<remove-appsec-private-constants> |
|
APPSEC_EVENT_RULE_VERSION |
📝<remove-appsec-private-constants> |
|
APPSEC_EVENT_RULE_ERRORS |
📝<remove-appsec-private-constants> |
|
APPSEC_EVENT_RULE_LOADED |
📝<remove-appsec-private-constants> |
|
APPSEC_EVENT_RULE_ERROR_COUNT |
📝<remove-appsec-private-constants> |
|
APPSEC_WAF_DURATION |
📝<remove-appsec-private-constants> |
|
APPSEC_WAF_DURATION_EXT |
📝<remove-appsec-private-constants> |
|
APPSEC_WAF_TIMEOUTS |
📝<remove-appsec-private-constants> |
|
APPSEC_WAF_VERSION |
📝<remove-appsec-private-constants> |
|
APPSEC_ORIGIN_VALUE |
📝<remove-appsec-private-constants> |
|
APPSEC_BLOCKED |
📝<remove-appsec-private-constants> |
|
IAST_JSON |
📝<remove-appsec-private-constants> |
|
IAST_ENABLED |
📝<remove-appsec-private-constants> |
|
IAST_CONTEXT_KEY |
📝<remove-appsec-private-constants> |
|
ddtrace.contrib.fastapi.patch |
span_modifier |
📝<remove-fastapi-starlette-span-modifier> |
aggregate_resources |
📝<remove-fastapi-starlette-aggregate-resources> |
|
ddtrace.contrib.starlette.patch |
span_modifier |
📝<remove-fastapi-starlette-span-modifier> |
aggregate_resources |
📝<remove-fastapi-starlette-aggregate-resources> |
|
get_resource |
📝<remove-fastapi-starlette-span-modifier> |
|
ddtrace.contrib.grpc.constants |
GRPC_PORT_KEY |
📝<remove-grpc-port-key> |
ddtrace.ext.cassandra |
ROW_COUNT |
📝<remove-cassandra-row-count> |
ddtrace.ext.mongo |
ROWS |
📝<remove-mongo-row-count> |
ddtrace.ext.sql |
ROWS |
📝<remove-sql-row-count> |
ddtrace.filters |
TraceCiVisibilityFilter |
📝<remove-trace-ci-visibility-filter> |
ddtrace.tracer |
DD_LOG_FORMAT |
📝<remove-dd-log-format> |
<div id="remove-dd-gevent-patch-all">
DD_GEVENT_PATCH_ALL is removed. There is no special configuration necessary to make ddtrace work with gevent if using ddtrace-run.
</div>
<div id="remove-aws-tag-all-params">
DD_AWS_TAG_ALL_PARAMS is removed. The boto/botocore/aiobotocore integrations no longer collect all API parameters by default.
</div>
<div id="rename-remote-config-poll-seconds">
DD_REMOTECONFIG_POLL_SECONDS is removed. Use the environment variable DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS instead.
</div>
<div id="remove-appsec-private-constants">
APPSEC_ENABLED, APPSEC_JSON, APPSEC_EVENT_RULE_VERSION, APPSEC_EVENT_RULE_ERRORS, APPSEC_EVENT_RULE_LOADED, APPSEC_EVENT_RULE_ERROR_COUNT, APPSEC_WAF_DURATION, APPSEC_WAF_DURATION_EXT, APPSEC_WAF_TIMEOUTS, APPSEC_WAF_VERSION, APPSEC_ORIGIN_VALUE, APPSEC_BLOCKED, IAST_JSON, IAST_ENABLED, IAST_CONTEXT_KEY are removed. This should not affect existing code as these deprecated ASM constants were meant for private use only.
</div>
<div id="remove-fastapi-starlette-span-modifier">
ddtrace.contrib.starlette.get_resource, ddtrace.contrib.starlette.span_modifier, and ddtrace.contrib.fastapi.span_modifier are removed. The starlette and fastapi integrations now provide the full route and not just the mounted route for sub-applications.
</div>
<div id="remove-fastapi-starlette-aggregate-resources">
ddtrace.contrib.starlette.config['aggregate_resources'] and ddtrace.contrib.fastapi.config['aggregate_resources'] are removed. The starlette and fastapi integrations no longer have the option to aggregate_resources, as it now occurs by default.
</div>
<div id="remove-grpc-port-key">
ddtrace.contrib.grpc.constants.GRPC_PORT_KEY is removed. Use ddtrace.ext.net.TARGET_PORT instead.
</div>
<div id="remove-cassandra-row-count">
ddtrace.ext.cassandra.ROW_COUNT is removed. Use ddtrace.ext.db.ROWCOUNT instead.
</div>
<div id="remove-mongo-row-count">
ddtrace.ext.mongo.ROW_COUNT is removed. Use ddtrace.ext.db.ROWCOUNT instead.
</div>
<div id="remove-sql-row-count">
ddtrace.ext.sql.ROW_COUNT is removed. Use ddtrace.ext.db.ROWCOUNT instead.
</div>
<div id="remove-trace-ci-visibility-filter">
ddtrace.filters.TraceCiVisibilityFilter is removed.
</div>
<div id="remove-dd-log-format">
ddtrace.tracer.DD_LOG_FORMAT is removed. As an alternative, please follow the log injection formatting as provided in the log injection docs.
</div>
<div id="remove-basic-config">
DD_CALL_BASIC_CONFIG is removed. There is no special configuration necessary to replace DD_CALL_BASIC_CONFIG. The ddtrace logger will log to stdout by default or additionally to a file specified by DD_TRACE_LOG_FILE.
</div>
<div id="remove-trace-obfuscation-query-string-pattern">
DD_TRACE_OBFUSCATION_QUERY_STRING_PATTERN is removed. Use DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP instead.
</div>
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
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
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
Vulnerability Management for Code-level (IAST) is now available in private beta. Use the environment variable DD_IAST_ENABLED=True to enable this feat…
Vulnerability Management for Code-level (IAST) is now available in private beta. Use the environment variable DD_IAST_ENABLED=True to enable this feature.
set_produce_checkpoint and set_consume_checkpointNothing 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
Nothing published for this version
ASM: Adds detection of insecure cookie vulnerabilities on responses.
allow_false keyword argument to BaseSampler.sample(), which defaults to True. allow_false controls the function's return value. If allow_false is False, the function will always return True regardless of the sampling decision it made. This is useful when sample is called only for its side effects, which can include setting span tags.DD_UNLOAD_MODULES_FROM_SITECUSTOMIZE is set to True.ASM: avoid potentially unneeded import of the IAST native module.
ASM: avoid potentially unneeded import of the IAST native module if setup doesn't build extensions correctly.
data_streams: This fix resolves an issue where data stream context propagation would not propagate via SNS if raw message delivery was enabled.
dynamic instrumentation: function duration measurements are now reported in milliseconds to match the expectation from the UI.
dynamic instrumentation: fixed an issue that prevented line probes from being injected in some finally blocks.
dynamic instrumentation: Fixed the programmatic API to ensure that the dynamic instrumentation service is fully enabled when Dynamic Instrumentation.enable() is called.
dynamic instrumentation: fixed a bug that might have caused probe status to fail to update correctly.
django: This fix resolves an issue where 'span.resource' would not include the endpoint when a Handler was interrupted, such as in the case of gunicorn worker timeouts.
CI Visibility: fixes an issue where the Intelligent Test Runner would not work when in EVP proxy mode due to missing X-Datadog-NeedsAppKey header.
CI Visibility: revert to using DD_CIVISIBILITY_ITR_ENABLED (instead of _DISABLED) to conform with other tracers.
profiling: fixed a bug that prevented profiles from being correctly correlated to traces in gevent-based applications, thus causing code hotspot and end point data to be missing from the UI.
docs: Fix undefined variable reference in otel documentation
CI Visibility: fixes that Python 2.7 test results were not visible in UI due to improperly msgpack-ed data
ASM: This fix resolves an issue where <span class="title-ref">track_user_signup_event</span> and <span class="title-ref">track_custom_event</span> where not correctly tagging the span. This could lead to the loss of some events in the sampling.
appsec: Fixes an issue where ddtrace.appsec is imported and assumed to be available in all deployments of ddtrace
lib-inject: This fix resolves an issue where libdl.so.2: cannot open shared object file: No such file or directory errors occurred when the
injection image started.
lib-injection: Resolves permissions errors raised when ddtrace packages are copied from the InitContainer to the shared volume.
mariadb: This fix resolves an issue where MariaDB connection information objects not including the user or port caused exceptions to be raised.
appsec: This fix resolves an issue in which the library attempted to finalize twice a context object used by the Application Security Management product.
propagation: Prevent propagating unsupported non-ascii origin header values.
pymongo: This upgrades the PyMongo integration to work with PyMongo versions 4.5.0 and above by choosing the root function of the integration on the basis of the PyMongo version.
tracing: This fix resolves an issue where the <span class="title-ref">_dd.p.dm</span> and <span class="title-ref">_dd.*_psr</span> tags were applied to spans in ways that did not match their intended semantics, increasing the potential for metrics-counting bugs.
ASM: This fix resolves issue where user information was only set in root span. Now span for user information can be selected.
sqlalchemy: sqlalchemy rollbacks could previously cause intermittent deadlocks in some cases. To fix this DD_TRACE_SPAN_AGGREGATOR_RLOCK was introduced in 1.16.2 with the default as False. We are now changing the default to True.
DD_TRACE_OBFUSCATION_QUERY_STRING_PATTERN to DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP.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
Nothing published for this version
Nothing published for this version
ASM: The vulnerability report now includes a feature to scrub potentially sensitive information. This scrubbing process looks for common patterns, and…
Data Streams Monitoring (DSM) has added support for AWS Kinesis
Breaking change for CI Visibility: test.suite and test.full_name are changed, so any visualization or monitor that uses these fields is potentially affected.
DD_CALL_BASIC_CONFIG will be removed in the upcoming 2.0.0 release. As an alternative to DD_CALL_BASIC_CONFIG, you can call logging.basicConfig() to configure logging in your application.DD_LOG_FORMAT is deprecated and will be removed in 2.0.0. As an alternative, please follow the log injection formatting as provided in the log injection docs.CI Visibility: added tracing support for pytest-benchmark
ASM: The vulnerability report now includes a feature to scrub potentially sensitive information. This scrubbing process looks for common patterns, and it can be further expanded using environment variables such as DD_IAST_REDACTION_NAME_PATTERN and DD_IAST_REDACTION_VALUE_PATTERN. See the docs for more information.
DSM: Adds DSM support for AWS Kinesis. For information about DSM, see the official documentation. This change requires users to use botocore version 1.26.30 or later and update calls to Kinesis' <span class="title-ref">PutRecord</span>, <span class="title-ref">PutRecords</span>, and <span class="title-ref">GetRecords</span> calls with the StreamARN argument.
pytest: This change introduces an option to the pytest plugin to disable ddtrace: --no-ddtrace
CI visibility: Adds support for tracking repository URLs via the BITBUCKET_GIT_HTTP_ORIGIN environment variable
CI visibility: Adds CodeFresh integration
CI Visibility: Beta release of pytest support for the Intelligent Test Runner .
openai: tiktoken has been introduced as an optional package dependency to calculate the number of
tokens used in a prompt for a streamed completion or streamed chat completion. To enable this feature, install ddtrace[openai] or tiktoken. If tiktoken is not installed, the prompt token count will be continue to be estimated instead.
Allows the use of a new backend for storing and exporting profiling data. This feature can be enabled for now by setting the DD_PROFILING_EXPORT_LIBDD_ENABLED environment variable to true. This should improve performance while decreasing memory overhead.
DD_TRACE_SPAN_AGGREGATOR_RLOCK=True. After testing and feedback we intend to make True the default value.CI Visibility: fixes an issue where the CIVisibility client would raise an exception if it was started in agentless mode without the DD_API_KEY set
core: This fix moves cmake from install_requires to setup_requires.
data_streams: This change fixes a bug in the Kafka & SQS integrations in which the Data Streams product code incorrect set timestamps for statistics. This led to all points being submitted for the same timestamp (the start of the application).
dynamic instrumentation: handle null literal in conditions and expressions.
dynamic instrumentation: fixed a bug that prevented span decoration probes from being received and instrumented.
dynamic instrumentation: ensure that probes that fail to be instrumented because of invalid conditions/expressions are reported with status ERROR in the UI.
CI Visibility: This fix solves an issue where the git unshallow command wasn't called
tracing: Ensures health metrics are tagged with the correct values.
CI Visibility: This fix resolves an issue where test skipping was not working properly.
langchain: This fix resolves an issue where chat messages and embedding arguments
passed in as keyword arguments were not parsed correctly and resulted in an ArgumentError.
langchain: This fix resolves an issue where langchain.embeddings.HuggingFaceEmbeddings embedding
methods, and langchain.vectorstores.Milvus.similarity_search were patched twice due to a nested class hierarchy in langchain.
profiling: prevent deadlocks while recording events of different type.
pytest: This fix resolves an issue where test modules could be non-existent, causing errors in the CI Visibility product.
kafka: Resolves UnicodeDecodeError raised when kafka messages key contain characters that are not supported by UTF-8 encoding.
lib-injection: Adds support for non-root run applications in containers.
This fix resolves an issue causing span tags used by the Datadog backend not to be inherited by spans that exist in a different process from their parents.
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
Datadog has added support for automatically creating login success or failure events when a configured Django authentication backend is used. This wil
Datadog has added support for automatically creating login success or failure events when a configured Django authentication backend is used. This will automatically fill the following tags in these cases:
- <span class="title-ref">appsec.events.users.login.success.track</span>
- <span class="title-ref">appsec.events.users.login.failure.track</span>
- <span class="title-ref">appsec.events.users.login.success.[email|login|username]</span>
- <span class="title-ref">appsec.events.users.login.failure.usr.exists</span>
ASM: Add support for automatic user login events in Django.
langchain: Adds integration with support for metrics, logs, and traces from LangChain requests.
See the docs<langchain> for more information.
redis: Add support for Async RedisCluster.
benchmarks/ directory in the ddtrace wheels._fixupChildren when retrieving DDLogger"RuntimeError: the memalloc module was not started."google.protobuf import error when module unloading.environ property HTTPS as an HTTP header.cython<3 due to an incompatibility with cython==3.0.0 and typing annotations in profiling code.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
ASM: vulnerabilities related to insecure request cookies will be reported when DD_APPSEC_ENABLED is set to true.
Application Security Management (ASM) has added support for tracing subprocess executions.
Exception Debugging allows capturing debug information from exceptions attached to traces. The information about local variables and function arguments is displayed in the Error Tracking UI and augments the traceback data already collected.
ASM: vulnerabilities related to insecure request cookies will be reported when DD_APPSEC_ENABLED is set to true.
ASM: add support for tracing subprocess executions (like <span class="title-ref">os.system</span>, <span class="title-ref">os.spawn</span>, <span class="title-ref">subprocess.Popen</span> and others) and adding information to a span names <span class="title-ref">command_execution</span> with the new type <span class="title-ref">system</span>. Currently we add the <span class="title-ref">cmd.exec</span> or <span class="title-ref">cmd.shell</span> tags to store the full command line (<span class="title-ref">cmd.shell</span> will be used when the command is run under a shell like with <span class="title-ref">os.system</span> or <span class="title-ref">Popen</span> with <span class="title-ref">shell=True</span>), <span class="title-ref">cmd.exit_code</span> to hold the return code when available, <span class="title-ref">component</span> which will hold the Python module used and the span <span class="title-ref">resource</span> will hold the binary used. This feature requires ASM to be activated using the <span class="title-ref">DD_APPSEC_ENABLED=True</span> configuration environment variable.
botocore: Introduces environment variable DD_BOTOCORE_INSTRUMENT_INTERNALS that opts into tracing certain internal functionality.
botocore: Added message attributes to Amazon Simple Queue Service spans to support data streams monitoring.
exception debugging: Introduced the Exception Debugging feature that allows capturing debug information from exceptions attached to traces. This new feature can be enabled via the <span class="title-ref">DD_EXCEPTION_DEBUGGING_ENABLED</span>` environment variable.
openai: Adds support for metrics, logs, and traces for the models, edits, images, audio, files, fine-tunes, and moderations endpoints. See the docs for more information.
CI Visibility: Updates how pytest modules and test suites are reported. Modules names are now set to the fully qualified name, whereas test suites will be set to the file name. Before this change: {"module": "tests", "suite":"my_module/tests/test_suite.py"} After this change: {"module": "my_module.tests", "suite": "test_suite.py"}
core: Apply DD_TAGS to runtime metrics.
kafka: Adds <span class="title-ref">messaging.kafka.bootstrap.servers</span> tag for the confluent-kafka producer configuration value found in <span class="title-ref">metadata.broker.list</span> or <span class="title-ref">bootstrap.servers</span>
tracing: This reports the GRPC package name (optional) and service name in a single <span class="title-ref">rpc.service</span> tag
TypeError raised when an async cursor object is traced. This fix ensures <span class="title-ref">exc_type</span>, <span class="title-ref">exc_val</span>, and <span class="title-ref">exc_tb</span> are passed down to the wrapped object on <span class="title-ref">__aexit__</span>.ImportError of TypedDict from typing module in Python 3.7.unittest.TestCase classes were used.graphql.execute spans are now marked as measured.HashClient failed when use_pooling was set.Nothing published for this version
One column per quarter.