github DataDog/dd-trace-py v2.1.0
2.1.0

latest releases: v2.16.1, v2.14.7, v2.15.2...
13 months ago

Upgrade Notes

  • pymemcache: The memcached.query span 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 setting DD_TRACE_MEMCACHED_COMMAND_ENABLED=true. This span tag can be redacted using DD_APM_REPLACE_TAGS in 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 using ddtrace-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_ENABLED environment 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_VERSION to v04 by 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 ValueError raised when Consumer.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 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.
  • redis: Resolves UnboundLocalError raised when a traced redis command raises an exception.
  • graphql: Resolves AttributeError raised while parsing graphql Documents where AST Location is None.
  • 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.
  • 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.

Other Changes

  • remote config: change log levels of messages about agent down or request config to debug level.

Don't miss a new dd-trace-py release

NewReleases is sending notifications on new releases.