Change8

v4.2.0rc1

📦 datadog-sdk
14 features🐛 17 fixes1 deprecations🔧 27 symbols

Summary

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

Migration Steps

  1. If you were using `config.<integration>.hooks` 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.

✨ New Features

  • LLM Observability: Tracing of `initialize` requests and their responses on modelcontextprotocol/python-sdk servers is added.
  • LLM Observability: Automatic `source:otel` tagging for evaluations is introduced when OpenTelemetry (OTel) tracing is enabled via `DD_TRACE_OTEL_ENABLED=true`, allowing the backend to wait for OTel span conversion.
  • LLM Observability: Format of MCP server tool call span input, output, and tags is changed to include the full request and response objects.
  • LLM Observability: Reasoning token counts are now captured from VertexAI responses.
  • Profiling: Support for `asyncio.BoundedSemaphore` lock type profiling added to Python Lock Profiler.
  • Profiling: Support for `asyncio.Condition` locking type profiling added, providing visibility into `asyncio.Condition` usage.
  • Profiling: Support for `asyncio.Semaphore` lock type profiling added to Python Lock Profiler.
  • AAP: Business logic event detection for Stripe is added, instrumenting payment intent/checkout session creation and related payment intent events.
  • AAP: Proxy inferred spans now contain events when AppSec is enabled for reporting on the App and API Protection Endpoint Catalog.
  • DBM: Container tags support is added.
  • DSM: Container tags support is added.
  • 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 `x-dd-proxy` header is set to `aws-httpapi`.
  • Tracing: For API Gateway v2, the tag `http.route` and the span resource name now contain the API resource path when propagated via the `x-dd-proxy-resource-path` header.
  • vLLM: Tracing and LLM Observability support is introduced for vLLM V1 engine (requires vLLM >= 0.10.2).

🐛 Bug Fixes

  • CI Visibility: Resolved an issue causing an exception during code coverage instrumentation in Python 3.9 when handling line numbers in corner cases.
  • Crash Tracking: Fixed conflicts in export location derivation by only passing the `DD_CRASHTRACKING_ERRORS_INTAKE_ENABLED` environment variable to the crashtracker receiver process.
  • Falcon: Fixed support for `DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED`, which was previously ignored.
  • Tracing: Proxy inferred spans no longer omit the `https://` scheme prefix from the `http.url` tag.
  • psycopg: Fixed an `OperationalError` occurring when patching a closed psycopg3 connection.
  • Dynamic Instrumentation: Fixed an evaluation error caused by condition expressions containing `isDefined`.
  • Dynamic Instrumentation: Fixed an issue preventing autocomplete information extraction from the running application.
  • OpenFeature: Resolved an issue where FFE was not receiving remote configuration in forking web server environments (gunicorn, uWSGI), causing the provider to return default values. FFE is now properly registered during tracer initialization when enabled.
  • OpenFeature: Fixed exposure event deduplication to use (flag_key, subject_id) as the cache key, respecting the `do_log` flag and adding LRU eviction.
  • Ray: Resolved a crash caused by `None` metadata in Ray job submission.
  • OpenAI Agents: Fixed an `AttributeError` when calling `tag_agent_manifest` due to a missing active span.
  • Profiling: Fixed an issue where the Lock profiler failed to call necessary initialization functions, sometimes causing crashes.
  • Profiling: The Profiler now consistently uses the name of leaf tasks for the "Task name" label, fixing inconsistent behavior where parent task names were sometimes used.
  • Profiling: Fixed a `TypeError` crash when profiling code that subclasses wrapped locks (e.g., neo4j's `AsyncRLock`).
  • Profiling: Resolved a bug causing crashes when using `uvloop` and forking.
  • Profiling: Improved accuracy of stacks for on-CPU asyncio Tasks by reducing stack pollution between Tasks.
  • Profiling: The build now uses the correct location for the native extension module.

🔧 Affected Symbols

config.<integration>.hooksregister()on()deregister()emit()ddtrace.trace_utils.get_current_spanddtrace.trace_utils.get_current_root_spanasyncio.BoundedSemaphoreasyncio.Conditionasyncio.Semaphorepayment intent creationcheckout session creationpayment_intent.succeededpayment_intent.payment_failedpayment_intent.canceledaws.httpapihttp.routex-dd-proxyx-dd-proxy-resource-pathvLLM V1 engineDD_TRACE_OTEL_ENABLEDisDefinedDD_CRASHTRACKING_ERRORS_INTAKE_ENABLEDDD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLEDpsycopg3 connectionDD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLEDtag_agent_manifest

⚡ 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. Use `ddtrace.trace_utils.get_current_span()` or `ddtrace.trace_utils.get_current_root_span()` instead to interact with spans.