Change8

v4.2.0rc2

📦 datadog-sdkView on GitHub →
17 features🐛 21 fixes1 deprecations🔧 33 symbols

Summary

This release introduces significant new features for LLM Observability, enhanced profiling capabilities for asyncio locks and tasks, and business logic detection for Stripe via AAP. It also deprecates the `Hooks` class in favor of direct span utility functions.

Migration Steps

  1. If you were using `config.<integration>.hooks` or its methods (`register()`, `on()`, `deregister()`, `emit()`), update your code to use `ddtrace.trace_utils.get_current_span()` or `ddtrace.trace_utils.get_current_root_span()` instead to interact with spans.

✨ New Features

  • LLM Observability: Adds tracing of `initialize` requests and their responses on modelcontextprotocol/python-sdk servers.
  • LLM Observability: Introduces automatic `source:otel` tagging for evaluations when OpenTelemetry (OTel) tracing is enabled when `DD_TRACE_OTEL_ENABLED=true` is set.
  • LLM Observability: Changes format of MCP server tool call span input, output, and tags to include the full request and response objects.
  • LLM Observability: Reasoning token counts are now captured from VertexAI responses.
  • LLM Observability: Adds ability to automatically capture the intent and context of an MCP server tool call to modelcontextprotocol/python-sdk servers using the `DD_MCP_CAPTURE_INTENT` environment variable.
  • Profiling: Add support for `asyncio.BoundedSemaphore` lock type profiling in Python Lock Profiler.
  • Profiling: Add support for `asyncio.Condition` locking type profiling in Python.
  • Profiling: Add support for `asyncio.Semaphore` lock type profiling in Python Lock Profiler.
  • Profiling: The Profiler now properly stacks flame graphs for Tasks awaiting and awaited through `asyncio.shield`.
  • Profiling: The Profiler now tracks Tasks created through `asyncio.TaskGroup`.
  • AAP: Add business logic event detection for Stripe, instrumenting payment intent/checkout session creation and payment events.
  • AAP: Proxy inferred spans now contain events when AppSec is enabled for reporting on the App and API Protection Endpoint Catalog.
  • DBM: Adds container tags support.
  • DSM: Adds container tags support.
  • Tracing: Proxy inferred spans now differentiate between API Gateway v1 and v2 apis by emitting the `aws.httpapi` span name for v2 apis when the API Gateway sets the `x-dd-proxy` header to `aws-httpapi`.
  • Tracing: The resource name of the span and the tag `http.route` now contains the api resource path instead of the path when propagated with the `x-dd-proxy-resource-path` header.
  • vLLM: Introduces tracing and LLM Observability support for vLLM V1 engine (requires vLLM >= 0.10.2).

🐛 Bug Fixes

  • CI Visibility: Resolves an issue where code coverage instrumentation in Python 3.9 would raise an exception while handling line numbers in some corner cases.
  • Crash Tracking: Fixes conflicts with export location derivation by only passing the `DD_CRASHTRACKING_ERRORS_INTAKE_ENABLED` environment variable to the crashtracker receiver process.
  • Falcon: Fixes `DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED` support, which was previously ignored.
  • Tracing: Proxy inferred spans used to omit the `https://` scheme prefix in the `http.url` tag, causing incorrect URL parsing.
  • psycopg: Fixes an OperationalError that occurred when patching a closed psycopg3 connection.
  • Dynamic Instrumentation: Fixed an issue that caused condition expressions containing `isDefined` to result in an evaluation error.
  • Dynamic Instrumentation: Fixed an issue that prevented autocomplete information to be extracted from the running application.
  • OpenFeature: Resolves an issue where Feature Flagging and Experimentation (FFE) was not receiving remote configuration in forking web server environments (gunicorn, uWSGI).
  • OpenFeature: Fix exposure event deduplication to use (flag_key, subject_id) as cache key instead of (flag_key, variant_key, allocation_key).
  • Ray: Resolves an issue where `None` metadata in Ray job submission caused a crash.
  • OpenAI Agents: Resolves an issue where a missing active span caused an `AttributeError` when calling `tag_agent_manifest`.
  • LLM Observability: Resolves an issue where using multiple sequential `annotation_context` blocks caused annotations to fail after the first operation in subsequent contexts due to stale trace context.
  • LLM Observability: Resolves an issue in `activate_distributed_headers()` where distributed requests missing a LLM Observability trace ID would be incorrectly propagated twice.
  • Profiling: Resolves an issue where memory profiler module fails to load when the system doesn't have libatomic installed.
  • Profiling: Resolves an issue where the Lock profiler would not call the necessary initialization function, sometimes resulting in crashes.
  • Profiling: The Profiler now always uses the name of leaf tasks for the "Task name" label.
  • Profiling: Fixes a bug where code that sub-classes wrapped locks crashes with `TypeError` during profiling (e.g., neo4j's `AsyncRLock`).
  • Profiling: A bug causing crashes when using `uvloop` and forking has been resolved.
  • Profiling: Improves the accuracy of stacks for on-CPU asyncio Tasks by reducing the odds of Frames for a Task polluting the stack of other Tasks.
  • Profiling: The build now uses the correct location for the native extension module, fixing import issues for the memory profiler extension in published wheels.
  • SSI: Fixes an issue where ddtrace fails to find `_psutil_linux.abi3.so` file in an injected environment.

🔧 Affected Symbols

config.<integration>.hooksregister()on()deregister()emit()ddtrace.trace_utils.get_current_span()ddtrace.trace_utils.get_current_root_span()asyncio.BoundedSemaphoreasyncio.Conditionasyncio.Semaphoreasyncio.shieldasyncio.TaskGrouppayment intent creationcheckout session creationpayment_intent.succeededpayment_intent.payment_failedpayment_intent.canceledDD_TRACE_OTEL_ENABLEDDD_MCP_CAPTURE_INTENTx-dd-proxyx-dd-proxy-resource-pathhttp.routevLLM V1 engineDD_CRASHTRACKING_ERRORS_INTAKE_ENABLEDDD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLEDpsycopg3 connection patchingisDefinedDD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLEDtag_agent_manifestactivate_distributed_headers()annotation_contextuvloop_psutil_linux.abi3.so

⚡ Deprecations

  • The `Hooks` class (`config.<integration>.hooks`) is deprecated and will be removed in v5.0. All hook methods (`register()`, `on()`, `deregister()`, `emit()`) are now no-op and no longer affect span behavior.