Change8

v3.18.0rc2

📦 datadog-sdkView on GitHub →
5 features🐛 24 fixes4 deprecations🔧 13 symbols

Summary

This release introduces new features for API Security and LLM Observability, enhances profiling with RLock support, and resolves numerous bugs across integrations like LangChain, Ray, and OpenAI, while deprecating several older span tagging methods.

Migration Steps

  1. For streamed chat/completions, if you require accurate token metrics, set stream_options={"include_usage": True} in the OpenAI request, as token counts will now default to estimation unless explicitly provided in the OpenAI response.
  2. Replace calls to Span.set_tag_str with Span.set_tag.

✨ New Features

  • 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.
  • AppSec instrumentation for downstream request is now enabled by default for urllib3 and requests.
  • Add support for threading.RLock (reentrant lock) profiling, tracking both threading.Lock and threading.RLock usage.
  • LLMObs.pull_dataset now optionally supports pulling previous dataset versions by passing the version argument.
  • Datasets now have new properties version and latest_version to provide information on dataset versions.

🐛 Bug Fixes

  • Resolved performance issue affecting coverage collection for Python 3.12+ in CI Visibility.
  • Fixed an issue where only the first message in a Kafka batch was dispatched to Data Streams Monitoring (DSM) when consuming multiple messages.
  • Fixed auto instrumented prompt templates in langchain to omit the version field unless explicitly set by the user.
  • Fixed an issue in langchain where streamed responses ending before the first chunk was received would result in an IndexError.
  • Corrected the description of the assessment argument in LLMObs.submit_evaluation().
  • Resolved an issue in the bedrock integration where invoking cohere rerank models would result in missing spans due to output formatting index errors.
  • Resolved an issue where the langchain integration would incorrectly mark Azure OpenAI calls as duplicate llm operations even if the openai integration was enabled; Azure OpenAI spans are now traced as workflow spans if an equivalent llm span from the openai integration exists.
  • Resolved an issue where using async iteration with paginated openai methods caused a TypeError: 'async for' requires an object with __aiter__ method, got coroutine.
  • Fixed potential KeyError exceptions in pytest runs when gevent is detected.
  • Ensured that code location information is added to entry spans when Code Origin is enabled remotely.
  • Resolved an issue where exceptions raised in Ray child spans were not properly recorded in the trace.
  • Resolved an issue where the tracer raised an error when submitting Ray tasks without explicitly calling ray.init().
  • Stopped instrumenting internal Ray actors (starting with underscore) and added ray.data._internal to the module denylist.
  • Fixed an issue where using weak hashing or cipher algorithms outside of a request context in IAST could raise an unhandled exception.
  • Prevents OpenTelemetry OTLP exporter connections from being traced by ddtrace by excluding ddtrace internal connections from tracing.
  • Fixed circular import when enabling multiple OpenTelemetry signals (metrics + logs) simultaneously.
  • Fixed a potential race condition in the tracer.
  • Fixed AssertionError exceptions being silently suppressed in the Lock profiler's _acquire method (when assertions are enabled).
  • Introduced DD_PROFILING_API_TIMEOUT_MS environment variable to configure profile upload timeout; DD_PROFILING_API_TIMEOUT is marked for removal.
  • Upgraded echion to resolve an issue where stack profiler could allocate excessive memory and another issue causing infinite loops on Python 3.13.
  • Fixed the Python Detector regular expression to detect paths ending with only the major version number.
  • Fixed ddtrace internal logging when trace-log correlation is disabled, preventing ValueError: Formatting field not found in record: 'dd.service'.
  • Ensures compatibility with wrapt 2.0.0.
  • Fix compatibility with zope.event==6.0, resolving an issue where an application instrumented by ddtrace could crash at start.

🔧 Affected Symbols

Span.set_struct_tagSpan.get_struct_tagSpan.set_tag_strSpan.set_tagthreading.RLockLLMObs.pull_datasetLLMObs.submit_evaluationclient.models.listray.initDD_PROFILING_API_TIMEOUTDD_PROFILING_API_TIMEOUT_MSwraptzope.event

⚡ Deprecations

  • 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. Use Span.set_tag instead.
  • The V1 stack profiler is deprecated and will be removed in 4.0. DD_PROFILING_STACK_V2_ENABLED=false will no longer have an effect starting in 4.0.