v4.11.0rc1
📦 datadog-sdkView on GitHub →
✨ 22 features🐛 1 fixes🔧 20 symbols
Summary
This release introduces significant enhancements for LLM Observability, API Security routing normalization, and improved profiling visibility on Python 3.12+. It also updates Flask instrumentation to expose more detailed resource information and enhances CI Visibility logging correlation.
Migration Steps
- If you rely on the exact methods listed in Flask route definitions for API endpoint discovery, be aware that discovery now includes auto-added HEAD and OPTIONS methods.
- If using LLM Observability experiments, calling `.run()` without providing `task` and `dataset` will now raise a `ValueError`.
✨ New Features
- Flask: Resource exposure on non-empty WSGI SCRIPT_NAME now uses a new tag `flask.resource.full` if it differs from `span.resource`.
- Flask: API endpoint discovery now reports all served HTTP methods, including auto-added HEAD for GET and auto-handled OPTIONS.
- Tracing: Unconditionally collect `x-datadog-endpoint-scan` and `x-datadog-security-test` headers as `http.request.headers.x-datadog-endpoint-scan` and `http.request.headers.x-datadog-security-test` on service entry spans.
- DBM Propagation: Supports `dynamic_service` as a new `DD_DBM_PROPAGATION_MODE` value to inject DBM metadata without trace context.
- AI Guard: Added evaluation support for Anthropic SDK Messages instrumentation (streaming/non-streaming requests/responses) via `Messages.create` / `Messages.stream` and variants.
- aiokafka: Adds `kafka.partition` and `kafka.message_offset` tags to producer spans upon broker acknowledgment.
- ASM/FastAPI/Starlette: Introduces `_dd.appsec.normalized_route` span tag following RFC-1103 for API Security enabled requests.
- ASM/Flask: Extends support for `_dd.appsec.normalized_route` span tag to Flask request spans, normalizing route syntax.
- LLM Observability: Emits span links between step, LLM, and tool spans for multi-step traces in Claude Agent SDK integration.
- aws_durable_execution_sdk_python: Adds distributed tracing across suspend/resume cycles for durable workflows.
- AAP/Flask: API endpoint discovery now covers Flask sub-applications mounted via `DispatcherMiddleware`, reporting full mounted paths.
- google_cloud_pubsub: Introduces Data Streams Monitoring (DSM) context propagation for producer publish (injects context) and subscriber consume (extracts context).
- LLM Observability: Automatically tags spans and experiments with `git.commit.sha` and `git.repository_url` derived from environment variables, package metadata, or git CLI.
- LLM Observability: Experiment evaluators can return `MultiEvaluatorResult` to emit multiple named evaluation metrics from one call.
- LLM Observability: Adds `LLMObs.pull_experiment(experiment_id)` to fetch previously-run experiments from the backend.
- LLM Observability: `task` and `dataset` are now optional when creating an experiment via `LLMObs.experiment()` / `LLMObs.async_experiment()`, supporting pull-based workflows.
- LLM Observability: Propagates tool version from parent LLM span (`meta.tool.version`) to manually-started child tool spans.
- LLM Observability: Propagates tool version from parent LLM span to child tool spans as `meta.tool.version` for UI aggregation.
- Profiling: Fast stack profiler optimization is now enabled by default.
- Profiling: Heap profiler tracks allocations via `PYMEM_DOMAIN_MEM` (`PyMem_Malloc/Calloc/Realloc`) on Python 3.12+ when `DD_PROFILING_MEMORY_MEM_DOMAIN_ENABLED=true` is set.
- ray: Adds `DD_ML_JOB_ENV` environment variable for forwarding configuration to Ray job workers.
- CI Visibility: Adds `ddtrace.testing.logs.DDTestLogsHandler` for shipping logs from subprocesses correlated with CI Visibility traces.
🐛 Bug Fixes
- CI Visibility: Added `ddtrace.testing.logs.CorrelationFilter` base class and `ThreadLocalCorrelationFilter` for stamping trace/span IDs onto log records in subprocesses.
Affected Symbols
flaskDD_DBM_PROPAGATION_MODEAnthropic SDK Messages instrumentationaiokafka producer spanFastAPI request spanStarlette request spanFlask request spanaws_durable_execution_sdk_pythongoogle_cloud_pubsub producer publishgoogle_cloud_pubsub subscriber callbacksDD_GIT_COMMIT_SHADD_GIT_REPOSITORY_URLLLMObs.experimentLLMObs.async_experimentLLMObs.toolDD_PROFILING_MEMORY_MEM_DOMAIN_ENABLEDDD_ML_JOB_ENVddtrace.testing.logs.DDTestLogsHandlerddtrace.testing.logs.CorrelationFilterddtrace.testing.logs.ThreadLocalCorrelationFilter