github DataDog/dd-trace-py v3.18.0rc1
3.18.0rc1

pre-release21 hours ago

Estimated end-of-life date, accurate to within three months: 08-2026
See the support level definitions for more information.

Deprecation Notes

  • tracing
    • Span.set_struct_tag is deprecated and will be removed in v4.0.0 with no direct replacement.
    • Span.get_struct_tag is deprecated and will be removed in v4.0.0 with no direct replacement.
    • Span.set_tag_str is deprecated and will be removed in version 4.0.0.
      As an alternative to Span.set_tag_str, you can use Span.set_tag instead.
  • profiling: The V1 stack profiler is deprecated and will be removed in 4.0. V2 has been enabled by default since v2.20.0. DD_PROFILING_STACK_V2_ENABLED=false will no longer have an effect starting in 4.0.

New Features

  • AAP
    • API Security schema collection is now supported in AWS Lambda behind an Application Load Balancer or the Lambda Function URL service where the endpoint cannot be reliably known. API Security reuses the endpoint inferred by the trace resource renaming feature or recomputes it when it is not available to perform sampling instead.
    • AppSec instrumentation for downstream request is now enabled by default for urllib3 and requests. It does not require enabling APM instrumentation for urllib3 anymore.
  • profiling: Add support for threading.RLock (reentrant lock) profiling. The Lock profiler now tracks both threading.Lock and threading.RLock usage, providing comprehensive lock contention visibility for Python applications.
  • LLM Observability
    • Previous dataset versions can be optionally pulled by passing the version argument to LLMObs.pull_dataset
    • Datasets have new properties version and latest_version to provide information on the version of the dataset that is being worked with and the latest global version of the dataset, respectively

Bug Fixes

  • CI Visibility: This fix resolves performance issue affecting coverage collection for Python 3.12+
  • kafka: This fix resolves an issue where only the first message in a batch was dispatched to Data Streams Monitoring (DSM) when consuming multiple Kafka messages
  • langchain
    • This fix resolves an issue where auto instrumented prompt templates incorrectly included a version field. The version field is now omitted unless explicitly set by the user.
    • Fixes an issue where streamed responses that end before the first chunk is received would result in an IndexError.
  • LLM Observability
    • Corrected the description of the assessment argument in submit_evaluation().
      assessment now refers to whether the evaluation itself passes or fails according to your application, rather than the validity of the evaluation result.
    • Resolves an issue where the langchain integration would incorrectly mark Azure OpenAI calls as duplicate llm operations even if the openai integration was enabled.
      The langchain integration will trace Azure OpenAI spans as workflow spans if there is an equivalent llm span from the openai integration.
  • openai: This fix resolves an issue where using async iteration with paginated methods (e.g., async for model in client.models.list()) caused a TypeError: 'async for' requires an object with __aiter__ method, got coroutine. See issue #14574.
  • pytest plugin: fix for potential KeyError exceptions in test runs when gevent is detected within the environment.
  • code origin: ensure that code location information is added to entry spans when Code Origin is enabled remotely.
  • ray
    • This fix resolves an issue where exceptions raised in Ray child spans were not properly recorded in the trace.
    • This fix resolves an issue where the tracer raised an error when submitting Ray tasks without explicitly calling ray.init().
    • This fix stops instrumenting internal Ray actors (those starting with underscore) that were causing excessive noise, and adds ray.data._internal to the module denylist.
  • IAST: Fixed an issue where using weak hashing or cipher algorithms outside of a request context (e.g., during application startup) could raise an unhandled exception. The fix ensures proper error handling when IAST operations are performed without an active request context.
  • otel: Prevents OpenTelemetry OTLP exporter connections from being traced by ddtrace. ddtrace internal connections (gRPC and HTTP) are now excluded from tracing to prevent circular instrumentation.
  • Fix a potential race condition in the tracer.
  • profiling
    • DD_PROFILING_API_TIMEOUT doesn't have any effect, and is marked to be removed in upcoming 4.0 release. New environment variable DD_PROFILING_API_TIMEOUT_MS is introduced to configure timeout for uploading profiles to the backend. The default value is 10000 ms (10 seconds)
    • Upgrades echion to resolve an issue where stack profiler can allocate a large amount of memory unnecessarily. Resolves another issue where the profiler can loop infinitely on Python 3.13.
  • Fix the Python Detector regular expression so it also detects paths ending with only the major version number.
  • logging: Fixed ddtrace internal logging when trace-log correlation is disabled. Prevents ValueError: Formatting field not found in record: 'dd.service'.
  • tracer: This fix ensures compatibility with wrapt 2.0.0

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

NewReleases is sending notifications on new releases.