Releases: DataDog/dd-trace-py
1.20.4
Bug Fixes
- dynamic instrumentation: fix an issue that caused the probe instrumentation error details from being reported for visualization in the UI.
- This fix eliminates some reference leaks and C-API usage in the
_iastmodule. - openai: This fix resolves an issue where chat completion requests with function calls led to failing to tag null message content fields in the chat completion response.
- profiling: Load the protobuf module only if needed to avoid interfering with the module state for applications that also make use of it. The protobuf module is used in file and classic Python HTTP export. It is not needed for the libdatadog-based exporter.
- data_streams: This fix resolves an issue where including exit signal handling for message queues caused imports of ddtrace in a thread to fail.
- ASM: This fix resolves an issue where an f-string expression would not be formatted properly causing a segfault if IAST is enabled.
1.19.3
Bug Fixes
- Fix an issue that could have caused some tracing integrations to create invalid references to objects in Python frames, ultimately causing profiling tools to potentially induce a segmentation fault.
- Fix an issue that could have caused some tracing integrations to leave the interpreter in an inconsistent state, resulting in the profiler incurring a segmentation fault.
- data_streams: This fix resolves an issue where including exit signal handling for message queues caused imports of ddtrace in a thread to fail.
2.1.0
Upgrade Notes
- pymemcache: The
memcached.queryspan tag will no longer be set by the integration. This command includes keys that can potentially contain sensitive information. If you require this span tag, you can retain the existing functionality by settingDD_TRACE_MEMCACHED_COMMAND_ENABLED=true. This span tag can be redacted usingDD_APM_REPLACE_TAGSin your Agent configuration.
New Features
- CI Visibility: adds full test suite level visibility for unittest
- ASM: Add support for automatic user login events in Flask when using flask_login.
- tracer: This introduces collection of inferred service names. The agent version v7.46.0 contains a new field "extra_services" in the remote config client, that allows clients to list any additional services that are used within tracer spans. Knowing all service
names used by a tracer instance help the UI give better feedback to the user. - tracer: Adds support for
DD_TRACE_METHODS. This feature enables the
specification of custom methods to be instrumented by the tracer when usingddtrace-run. See the configuration documentation for more information: https://ddtrace.readthedocs.io/en/v2.1.0/configuration.html. - openai: This introduces official tracing support for Azure OpenAI services, specifically for completions, chat completions, and embeddings using models deployed on Azure OpenAI endpoints.
- Vulnerability Management for Code-level (IAST): Weak randomness vulnerability detection.
- pymemcache: add
DD_TRACE_MEMCACHED_COMMAND_ENABLEDenvironment variable for configuring the collection of memcached commands. This feature is disabled by default. - wsgi: This change introduces the keyword argument app_is_iterator to the DDWSGIMiddleware constructor. It's provided as a workaround for an issue where the Datadog WSGI middleware would fail to handle WSGI apps that are not their own iterators. This condition can arise when a Django app attempts to send its "request finished" signal, in which case it may cause connection leaks. Standard methods of distinguishing an iterable from its iterator, such as checking for the presence of iter and next dunder methods, don't work in this case for unknown reasons. Instead of adding brittle special-case detection logic to the middleware, this new argument allows users to indicate when this is the case.
Bug Fixes
- dbm: this fixes an issue with attributing metrics to incorrect services when peer.service is enabled
- tracing: Encoding traces in the v05 format has a known issue for applications generating spans at a high frequency, causing approximately 1/10000000 spans to be misencoded. This change sets
DD_TRACE_API_VERSIONtov04by default. - DSM: fix off-by-one metric issue and error where statistics weren't calculated when the core API was used.
- CI Visibility: Fixes incorrect Git version extraction
- kafka: Fixes
ValueErrorraised whenConsumer.commit(offsets=...)is called. - Resolves issues with the import machinery that might have caused the garbage collector to clean up weak references in an unexpected order.
- openai: This fix resolves an issue where chat completion requests with function calls led to failing to tag null message content fields in the chat completion response.
- profiling: Fixed an issue with data encoding where non-string objects might be interned on Python 3.11
- Fix an issue that could have caused some tracing integrations to create invalid references to objects in Python frames, ultimately causing profiling tools to potentially induce...
2.1.0rc2
Bug Fixes
- This fix resolves an issue where the library failed to install due to dependency conflicts caused by restrictive version specifiers on the psutil and Wrapt libraries.
- tracing: Fix an issue with some integrations, such as OpenAI, that caused an exception on start-up when using gevent.
- IAST: fix executed sink telemetry metric as it is not really linked to vulnerability report.
- profiling: Load the protobuf module only if needed to avoid interfering with the module state for applications that also make use of it. The protobuf module is used in file and classic Python HTTP export. It is not needed for the libdatadog-based exporter.
- tracing: Increases the maximum payload size and buffer size from 8MB to 20MB. Also decreases the maximum number of spans in trace chunks when
DD_TRACE_PARTIAL_FLUSH_ENABLED=True. This ensures large traces are correctly encoded and submitted. This should decrease the occurrence of "failed to send traces" error logs.
2.0.2
Bug Fixes
- DSM: fix off-by-one metric issue and error where statistics weren't calculated when the core API was used.
- tracing: Fix an issue with some integrations, such as OpenAI, that caused an exception on start-up when using gevent.
- IAST: fix executed sink telemetry metric as it is not really linked to vulnerability report.
- This fix eliminates some reference leaks and C-API usage in the
_iastmodule. - tracing: Increases the maximum payload size and buffer size from 8MB to 20MB. Also decreases the maximum number of spans in trace chunks when
DD_TRACE_PARTIAL_FLUSH_ENABLED=True. This ensures large traces are correctly encoded and submitted. This should decrease the occurrence of "failed to send traces" error logs.
Other Changes
- remote config: change log levels of messages about agent down or request config to debug level.
2.0.1
Bug Fixes
- This fix resolves an issue where the library failed to install due to dependency conflicts caused by restrictive version specifiers on the psutil and Wrapt libraries.
- openai: This fix resolves an issue where chat completion requests with function calls led to failing to tag null message content fields in the chat completion response.
- profiling: Load the protobuf module only if needed to avoid interfering with the module state for applications that also make use of it. The protobuf module is used in file and classic Python HTTP export. It is not needed for the libdatadog-based exporter.
- lib-injection: changes the log output to opt-in. Logging to stderr could interfere with applications. Logs can still be sent to stderr using DD_TRACE_DEBUG=1.
1.20.3
Bug Fixes
- DSM: fix off-by-one metric issue and error where statistics weren't calculated when the core API was used.
- Fix an issue that could have caused some tracing integrations to create invalid references to objects in Python frames, ultimately causing profiling tools to potentially induce a segmentation fault.
- Fix an issue that could have caused some tracing integrations to leave the interpreter in an inconsistent state, resulting in the profiler incurring a segmentation fault.
- lib-injection: changes the log output to opt-in. Logging to stderr could interfere with applications. Logs can still be sent to stderr using DD_TRACE_DEBUG=1.
2.1.0rc1
Upgrade Notes
- pymemcache: The
memcached.queryspan tag will no longer be set by the integration. This command includes keys that can potentially contain sensitive information. If you require this span tag, you can retain the existing functionality by settingDD_TRACE_MEMCA CHED_COMMAND_ENABLED=true. This span tag can be redacted usingDD_APM_REPLACE_TAGSin your Agent configuration.
New Features
-
CI Visibility: adds full test suite level visibility for unittest
-
ASM: Add support for automatic user login events in Flask when using flask_login.
-
tracer: This introduces collection of inferred service names. The agent version v7.46.0 contains a new field "extra_services" in the remote config client, that allows clients to list any additional services that are used within tracer spans. Knowing all service
names used by a tracer instance help the UI give better feedback to the user. -
tracer: Adds support for
DD_TRACE_METHODS. This feature enables the
specification of custom methods to be instrumented by the tracer when usingddtrace-run. See the configuration documentation for more information: https://ddtrace.readthedocs.io/en/v2.1.0/configuration.html. -
openai: This introduces official tracing support for Azure OpenAI services, specifically for completions, chat completions, and embeddings using models deployed on Azure OpenAI endpoints.
-
Vulnerability Management for Code-level (IAST): Weak randomness vulnerability detection.
-
pymemcache: add
DD_TRACE_MEMCACHED_COMMAND_ENABLEDenvironment variable for configuring the collection of memcached commands. This feature is disabled by default. -
wsgi: This change introduces the keyword argument app_is_iterator to the DDWSGIMiddleware constructor. It's provided as a workaround for an issue where the Datadog WSGI middleware would fail to handle WSGI apps that are not their own iterators. This condition can arise when a Django app attempts to send its "request finished" signal, in which case it may cause connection leaks. Standard methods of distinguishing an iterable from its iterator, such as checking for the presence of iter and next dunder methods, don't work in this case for unknown reasons. Instead of adding brittle special-case detection logic to the middleware, this new argument allows users to indicate when this is the case.
Bug Fixes
- dbm: this fixes an issue with attributing metrics to incorrect services when peer.service is enabled
- tracing: Encoding traces in the v05 format has a known issue for applications generating spans at a high frequency, causing approximately 1/10000000 spans to be misencoded. This change sets
DD_TRACE_API_VERSIONtov04by default. - DSM: fix off-by-one metric issue and error where statistics weren't calculated when the core API was used.
- CI Visibility: Fixes incorrect Git version extraction
- kafka: Fixes
ValueErrorraised whenConsumer.commit(offsets=...)is called. - Resolves issues with the import machinery that might have caused the garbage collector to clean up weak references in an unexpected order.
- openai: This fix resolves an issue where chat completion requests with function calls led to failing to tag null message content fields in the chat completion response.
- profiling: Fixed an issue with data encoding where non-string objects might be interned on Python 3.11
- Fix an issue that could have caused some tracing integrations to create invalid references to objects in Python frames, ultimately causing profiling tools to...
2.0.0
Prelude
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.
Important
If you are on version of Python not supported by v2, we will continue to maintain the ddtrace v1 with bug fixes.
Note
Before upgrading to v2.0.0, we recommend users install ddtrace~=1.20.19 and enable deprecation warnings. All removals to the library interface and environment variables in v2 were deprecated in the 1.x release line.
Note
The changes to environment variables apply only to the configuration of the ddtrace library and not the Datadog Agent.
Upgrading summary
Functionality changes
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' to enable B3 propagation has been removed. Please use DD_TRACE_PROPAGATION_STYLE='b3multi' instead.
Removed deprecated environment variables
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 |
|---|---|
DD_GEVENT_PATCH_ALL |
None |
DD_AWS_TAG_ALL_PARAMS |
None |
DD_REMOTECONFIG_POLL_SECONDS |
DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS |
DD_CALL_BASIC_CONFIG |
None |
DD_TRACE_OBFUSCATION_QUERY_STRING_PATERN |
DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP |
Removed deprecated library interfaces
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 |
|---|---|
ddtrace.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 |
|
ddtrace.contrib.fastapi.patch |
span_modifier |
aggregate_resources |
|
ddtrace.contrib.starlette.patch |
span_modifier |
aggregate_resources |
|
get_resource |
|
ddtrace.contrib.grpc.constants |
GRPC_PORT_KEY |
ddtrace.ext.cassandra |
ROW_COUNT |
ddtrace.ext.mongo |
ROWS |
ddtrace.ext.sql |
ROWS |
ddtrace.filters |
TraceCiVisibilityFilter |
ddtrace.tracer |
DD_LOG_FORMAT |
Upgrade Notes
-
DD_GEVENT_PATCH_ALLis removed. There is no special configuration necessary to make ddtrace work with gevent if using ddtrace-run. -
DD_AWS_TAG_ALL_PARAMSis removed. The boto/botocore/aiobotocore integrations no longer collect all API parameters by default. -
DD_REMOTECONFIG_POLL_SECONDSis removed. Use the environment variableDD_REMOTE_CONFIG_POLL_INTERVAL_SECONDSinstead. -
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_KEYare removed. This should not affect existing code as these deprecated ASM constants were meant for private use only. -
ddtrace.contrib.starlette.get_resource,ddtrace.contrib.starlette.span_modifier, andddtrace.contrib.fastapi.span_modifierare removed. The starlette and fastapi integrations now provide the full route and not just the mounted route for sub-applications. -
ddtrace.contrib.starlette.config['aggregate_resources']andddtrace.contrib.fastapi.config['aggregate_resources']are removed. The starlette and fastapi integrations no longer have the option toaggregate_resources, as it now occurs by default. -
ddtrace.contrib.grpc.constants.GRPC_PORT_KEYis removed. Useddtrace.ext.net.TARGET_PORTinstead. -
ddtrace.ext.cassandra.ROW_COUNTis removed. Useddtrace.ext.db.ROWCOUNTinstead. -
ddtrace.ext.mongo.ROW_COUNTis removed. Useddtrace.ext.db.ROWCOUNTinstead. -
ddtrace.ext.sql.ROW_COUNTis removed. Useddtrace.ext.db.ROWCOUNTinstead. -
ddtrace.filters.TraceCiVisibilityFilteris removed. -
ddtrace.tracer.DD_LOG_FORMATis removed. As an alternative, please follow the log injection formatting as provided in the log injection docs. -
DD_CALL_BASIC_CONFIGis removed. There is no special configuration necessary to replaceDD_CALL_BASIC_CONFIG. The ddtrace logger will log to stdout by default or additionally to a file specified byDD_TRACE_LOG_FILE. -
DD_TRACE_OBFUSCATION_QUERY_STRING_PATTERNis removed. UseDD_TRACE_OBFUSCATION_QUERY_STRING_REGEXPinstead.
New Features
- Adds support for Python 3.12.
- Vulnerability Management for Code-level (IAST): Weak randomness vulnerability detection.
Bug Fixes
- tracing: Encoding traces in the v05 format has a known issue for applications generating spans at a high frequency, causing approximately 1/10000000 spans to be misencoded. This change sets
DD_TRACE_API_VERSIONtov04by default.
Known Issues
- aiohttp: Python 3.12 is not supported.
- aiohttp-jinja: Python 3.12 is not supported.
- aiobotocore: Python 3.12 is not supported.
- asm: IAST for Python 3.12 is not supported.
- flask-caching: Python 3.12 is not supported.
- openai/langchain: Python 3.12 is not supported.
- opentelemetry-api: Python 3.12 is not supported.
- opentracing: Python 3.12 is not supported.
- pyramid: Python 3.12 is not supported.
- pynamodb: Python 3.12 is not supported.
- redis/redis-py-cluster: Python 3.12 is not supported.
1.20.2
Bug Fixes
- kafka: Fixes
ValueErrorraised whenConsumer.commit(offsets=...)is called. - profiling: Fixed an issue with data encoding where non-string objects might be interned on Python 3.11
- redis: Resolves
UnboundLocalErrorraised when a traced redis command raises an exception. - graphql: Resolves
AttributeErrorraised while parsing graphql Documents where AST Location is None.