Skip to content

4.18.0rc1

Pre-release
Pre-release

Choose a tag to compare

@mabdinur mabdinur released this 23 Nov 20:02
· 5 commits to main since this release
cbf6506

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

Upgrade Notes

  • tracing

    • Enable stats computation by default to compute RED metrics locally, which were previously computed by the agent. Set DD_TRACE_STATS_COMPUTATION_ENABLED=false to disable it.
    • The DATADOG TRACER CONFIGURATION startup log is now a JSON object instead of a Python dictionary, and it is emitted whenever DD_TRACE_STARTUP_LOGS is enabled, which is the default, even when the ddtrace logger level is above INFO. Set DD_TRACE_STARTUP_LOGS=false to disable it. The URLs it reports, such as agent_url, no longer include the user info, query, or fragment, which can hold credentials.
    • Changes the default OTLP protocol for metrics and logs from grpc to http/protobuf, matching traces, with default local endpoints on port 4318. Set OTEL_EXPORTER_OTLP_PROTOCOL=grpc or the signal-specific OTEL_EXPORTER_OTLP_METRICS_PROTOCOL / OTEL_EXPORTER_OTLP_LOGS_PROTOCOL to grpc to keep using a gRPC collector.
    • Removes the obsolete ddtrace[opentracing] installation extra; OpenTracing support was removed in v4.0. Applications that still need the opentracing package must install it directly.
    • DD_TRACE_STARTUP_LOGS now defaults to true, so ddtrace-run and ddtrace.auto log startup diagnostics, such as a warning when the agent is not reachable. Set DD_TRACE_STARTUP_LOGS=false to disable them.
  • LLM Observability

    • LLMObs.activate_distributed_headers() no longer raises an exception when the request headers have no APM trace context. It now logs a debug message and returns.
  • CI visibility

    • Uses the tested repository and revision consistently for test events, Test Impact Analysis requests and Git uploads, including custom and nested checkouts, while preserving explicit DD_GIT_* overrides. Matching detached CI checkouts retain their CI branch and canonical repository URL; the checkout root and provider merge commit are reported separately from the original CI workspace.
  • App and API Protection

    • Upgrades libddwaf to version 2.2.1.
  • ddtrace now requires ddtrace-internal 0.3.0, which carries the codeowners implementation that previously shipped inside ddtrace. The dependency itself is not new, but environments that install ddtrace from a private mirror or vendored wheelhouse must mirror the new version.

Deprecation Notes

  • openfeature
    • DD_FFE_INTAKE_ENABLED is deprecated and will be removed in 5.0.0. Use DD_FEATURE_FLAGS_EXPOSURES_DATADOG_LOGGING_ENABLED instead. Until then, DD_FFE_INTAKE_ENABLED keeps working. When both are set, DD_FEATURE_FLAGS_EXPOSURES_DATADOG_LOGGING_ENABLED takes precedence.

New Features

  • App and API Protection
    • API Security endpoint discovery now reports the routes of aiohttp web applications traced with ddtrace.contrib.aiohttp.trace_app, including the routes of their sub-applications, when the application starts. Set DD_API_SECURITY_ENDPOINT_COLLECTION_ENABLED=false to disable it.
    • Enables runtime vulnerability reachability detection in AWS Lambda when DD_APPSEC_SCA_ENABLED=true.
  • AI Guard
    • MCP tools converted with the Anthropic SDK mcp_tool and async_mcp_tool helpers are now evaluated before each call is sent to the MCP server, identifying the server from its MCP SDK client transport. Only the scheme, host and port of a remote server URL, or the command of a stdio server as configured with the package or python -m module name it runs, are reported; headers, environment variables and other arguments never are. Set DD_AI_GUARD_MCP_ENABLED=false to disable.
    • LangChain tool calls to MCP tools loaded with langchain-mcp-adapters (0.2.0 or later) are now evaluated with the MCP server that runs them, including calls made outside an agent, and are blocked before the MCP request is sent. Only the server name, transport, URL scheme, host and port, or stdio command and the package or module it runs are reported. Set DD_AI_GUARD_MCP_ENABLED=false to disable.
    • Evaluations of remote MCP tools run by the OpenAI Responses API now identify the MCP server of each call, and MCP approval requests are evaluated before the application can approve them. Responses streams whose MCP tools can request approval are buffered until that evaluation completes, even when DD_AI_GUARD_ANALYZE_STREAM_RESPONSES_ENABLED is off, and so are streams that use a reusable prompt unless DD_AI_GUARD_BLOCK is false. Only the scheme, host and port of the MCP server URL are reported: credentials, headers, and the URL user information, path, query string and fragment never are. Set DD_AI_GUARD_MCP_ENABLED=false to disable.
    • Evaluates the tool calls of MCP servers configured in the OpenAI Agents SDK before each call reaches the server, including direct server.call_tool calls. A blocking verdict raises AIGuardAbortError and the call is not sent. Set DD_AI_GUARD_MCP_ENABLED=false to disable.
    • The LiteLLM proxy guardrail now evaluates text completions, and it evaluates streamed answers after the last chunk. With DD_AI_GUARD_ANALYZE_STREAM_RESPONSES_ENABLED set to true, it holds a streamed answer until AI Guard evaluates it, and it can block the answer.
  • aiohttp
    • With config.aiohttp.disable_stream_timing_for_mem_leak=False (default), request spans now finish when request execution completes for both ordinary and streaming HTTP responses. WebSocket upgrade spans continue to finish at the handshake, independently of the socket lifetime.
  • algoliasearch
    • This introduces tracing support for algoliasearch 4.x. Calls to search_single_index on both SearchClientSync and SearchClient (async) create an algoliasearch.search span.
  • anthropic
    • Adds tracing and LLM Observability support for anthropic 1.x and 2.x.
  • azure frontdoor
    • Add inferred proxy span support for Azure Front Door (azure-fd). Enable it by setting DD_TRACE_INFERRED_PROXY_SERVICES_ENABLED=true.
  • botocore
    • Adds DD_TRACE_AWS_SDK_<SERVICE>_ENABLED (for example DD_TRACE_AWS_SDK_KINESIS_ENABLED=false) to skip instrumenting calls to a specific AWS service.
    • Adds the aws.sqs.queue.url, aws.stream.arn and aws.step_functions.state_machine.arn tags to SQS, Kinesis and Step Functions client spans when the request parameters include a queue URL, stream ARN or state machine ARN, and the aws.table.arn and aws.function.arn tags to DynamoDB and Lambda client spans when the request names the table or function by its full ARN. This also applies to the aiobotocore integration. The tags are not set when DD_AWS_TAG_NO_PARAMS is enabled.
  • CI Visibility
    • Adds diagnostic telemetry for the number of pages and time needed to retrieve known tests.
  • google_cloud_pubsub
    • Adds the gcp.pubsub.topic.name tag to publish spans and the gcp.pubsub.subscription.name tag to pull and push receive spans. Each tag holds the full resource path (projects/<project>/topics/<topic> or projects/<project>/subscriptions/<subscription>) and is only set when that full path is known. Existing tags are unchanged.
  • Code Security (IAST)
    • Adds vulnerability detection for aiohttp web applications traced with ddtrace.contrib.aiohttp.trace_app. Request headers, query parameters and form fields are only tracked with multidict 6.4 or later. Uploaded files and request bodies read through request.content or request.multipart() are not tracked.
    • Detects server-side request forgery (SSRF) when a URL built from user input is passed to the aiohttp client, through aiohttp.ClientSession request methods, ClientSession.ws_connect or aiohttp.request.
  • LLM Observability
    • LLM Observability traces now stay connected across services that drop the APM trace headers. The distributed context is also sent in the W3C baggage header, which requires baggage in DD_TRACE_PROPAGATION_STYLE (the default) and uses up to 8 of the 64 baggage items. In baggage, the parent agent name is truncated to 128 bytes (percent-encoded). Upgrade every service in the request path for full coverage.
    • Adds support for tracing Google GenAI Decisions API calls (client.decisions.create and client.aio.decisions.create, google-genai 3.2.0 and later), capturing the request with its questions, the answers, and token usage.
  • openfeature
    • Agentless Feature Flagging configuration requests now include the service name.
    • Adds an OpenFeature hook that passes each completed flag evaluation to a callback with the Datadog exposure decision and the selected split's features.
    • Adds DD_FEATURE_FLAGS_EXPOSURES_DATADOG_LOGGING_ENABLED, which controls whether feature flag exposure events are sent to Datadog. It defaults to true.
  • opentelemetry
    • The DATADOG TRACER CONFIGURATION startup log now reports the effective OpenTelemetry settings for traces, logs, and metrics, keyed by environment variable (for example OTEL_TRACES_EXPORTER and OTEL_EXPORTER_OTLP_TRACES_ENDPOINT), with OTLP header values redacted.
  • runtime metrics
    • Adds support for exporting runtime metrics over OTLP, under their OpenTelemetry semantic convention names, when DD_RUNTIME_METRICS_ENABLED and DD_METRICS_OTEL_ENABLED are both true.
  • Profiling
    • The profiler now has experimental support for remote configuration. Set DD_PROFILING_ENABLED=false to prevent Remote Configuration from starting the Profiler.

Bug Fixes

  • AAP
    • Fixes an issue where user signup events reported with a collection mode other than sdk recorded that mode under an incorrect span tag, so App and API Protection did not show how the signup event was collected.
    • Fixes an issue where an error while initializing the WAF could be raised in application code during the first traced operation. AAP now logs an error and stays disabled for that process instead.
  • AI Guard
    • Fixes an issue where LangChain tool calls with malformed arguments are not evaluated, so a model response containing only such calls bypasses AI Guard.
    • Fixes an issue where the full conversation is reported on the AI Guard span when DD_AI_GUARD_MAX_MESSAGES_LENGTH is set to 0.
    • Fixes an issue where evaluating async streamed OpenAI, Anthropic, or LangChain responses, or single-prompt async LangChain calls, with DD_AI_GUARD_ANALYZE_STREAM_RESPONSES_ENABLED=true blocked the asyncio event loop, stalling other tasks until the evaluation completed.
    • Fixes an issue where embeddings, audio transcription, and some other requests fail when the LiteLLM proxy guardrail uses the pre_call or during_call mode.
    • Fixes an issue where the LiteLLM proxy guardrail evaluates an answer without its real prompt when it uses only the post_call mode.
    • Fixes an issue where AI Guard evaluates chat and text completion prompts two times when the LiteLLM proxy guardrail uses pre_call and post_call modes.
    • Fixes an issue where AI Guard events in aiohttp applications were missing the client IP and user agent when App and API Protection threat detection is disabled.
  • aiohttp
    • Fixes unfinished request spans when both a parent application and its sub-application are instrumented with trace_app.
    • Fixes missing response status, headers, and resource information on request spans when an earlier response preparation callback fails.
    • Fixes missing or incorrect response metadata when timeout or other middleware runs request handlers in child tasks.
    • Fixes an issue where request spans were missing network.client.ip when client IP collection is enabled with DD_TRACE_CLIENT_IP_ENABLED and App and API Protection is disabled.
    • Fixes memory retention across keep-alive requests and unfinished request spans when streaming handlers fail or requests are cancelled.
  • LLM Observability
    • Fixes anthropic spans dropping temperature from their metadata on anthropic 1.x and 2.x, where the SDK takes it through extra_body instead of a request keyword. extra_body is now read as well, and an explicit keyword argument takes precedence.
    • Fixes an issue where Amazon Nova calls made with invoke_model_with_response_stream through the botocore integration reported 0 input and output tokens.
    • Fixes an issue where OpenAI Agents spans recorded internal information. Only non-secret settings and the scheme, host and port of MCP server URLs are now recorded.
    • Fixes an issue where a Bedrock ConverseStream tool call whose toolUse input was already a dict raised a TypeError from the traced stream, so the application's request failed. The parsed input is now recorded as the tool call arguments.
    • Fixes an issue where OpenAI Decisions API spans (client.decisions.create) dropped request options, JSON input parts, and custom tool call outputs, and recorded the questions in metadata instead of the span input. The span input is now the request as sent, and the span output is the response with the model and answers.
    • Fixes an issue where TypeSafe System One spans recorded every extra_body field in the span input. Only request fields are now recorded, since other fields can carry credentials.
  • asgi
    • Fixes request span completion order for mounted applications so child request spans finish before their enclosing request spans, while preserving the enclosing spans' response completion timestamps.
  • botocore
    • Fixes Kinesis trace context injection pushing a record over the 1 MiB limit. The size check now counts the UTF-8 bytes of the data plus the partition key.
    • Fixes increased latency on the first AWS SDK call when cloud request and response payload tagging are disabled, including the first invocation of an AWS Lambda function.
  • bottle
    • Fixes missing configured response-header tags for response objects returned or raised by route callbacks.
    • Fixes an issue where response metadata collection errors replace application responses or exceptions. Fixes missing HTTP status tags and incorrect span error classification when response headers cannot be collected.
  • CI Visibility
    • Fixes test suite events from the pytest plugin missing the test.module and test.module_path tags, which kept Datadog from recording test suite durations per module.
    • Fixes an issue where collecting per-test code coverage slowed down pytest's test collection and the start of each test process, more so in projects that import many modules.
    • Fixes an issue where Test Optimization lost test results in suites that block network access while their tests run, such as with pytest-socket, and failed the tests during which it sent them when the suite checks for blocked connections. Test Optimization now sends its requests with ddtrace's native HTTP client, which doesn't go through Python's socket module.
    • Fixes an issue where Test Optimization turned itself off with a Datadog Agent on a Unix domain socket, as with DD_TRACE_AGENT_URL=unix:///path/to/apm.socket or with /var/run/datadog/apm.socket, which it uses when that file exists and no agent URL, host or port is set: it requested the socket's path followed by /info and got a 404.
  • dynamic instrumentation
    • Metric probes whose value expression fails to evaluate, or does not evaluate to a number, now report the evaluation error instead of silently emitting nothing while the probe appears healthy.
    • Fixes an issue where Dynamic Instrumentation could fail to start with an import deadlock or a "partially initialized module" import error, most often on Python 3.14, when Code Origin for Spans or Exception Replay was enabled at the same time.
  • aiobotocore
    • Fixes an issue where spans were tagged with the DD_SERVICE value instead of aws.<endpoint> under the default (v0) span attribute schema. The service name now matches the botocore integration. Use DD_AIOBOTOCORE_SERVICE to set a custom service name.
  • tracing
    • Fixes the client IP reported for aiohttp and Sanic requests that repeat an IP header such as X-Forwarded-For. The header lines are now read in order as one comma-separated value, instead of only one of them, so a repeated DD_TRACE_CLIENT_IP_HEADER header is ignored like any value with several addresses.
    • Fixes a spurious "failed to start writer service" warning when multiple threads send their first traces concurrently.
    • Fixes OTLP logs and metrics export failures caused by uppercase protocol names or invalid protocol or compression settings; invalid values now warn and fall back to HTTP/protobuf or no compression. Compression settings also honor local and fleet configuration.
    • Fixes an issue where setting OTEL_SDK_DISABLED=true did not disable tracing, including OTLP trace export configured with OTEL_TRACES_EXPORTER=otlp. DD_TRACE_ENABLED still takes precedence when set.
    • ddtrace no longer overrides SIGTERM and SIGINT when the application ignores them. Before this fix, those signals caused the process to exit when running with ddtrace.
    • Fixes an issue where ddtrace import errors prevent applications launched with ddtrace-run from starting. Errors are reported and application startup continues.
  • aws_durable_execution_sdk_python
    • Fixes tracing with aws-durable-execution-sdk-python 3.x, where workflow spans were missing the aws.durable.replayed tag, trace context was not saved across suspend and resume, and map and parallel spans could report a branch's operation id.
  • App and API Protection
    • Fixes incorrect user emails in Django automatic login events when DD_USER_MODEL_EMAIL_FIELD is configured.
    • Fixes missing unsafe YAML deserialization findings when Interactive Application Security Testing (IAST) is enabled and input is passed using PyYAML's stream keyword argument.
    • Fixes missing SSRF detections when an outgoing request made from an HTTPX event hook or auth flow, or from a requests response hook, triggers the same rule as the request that started it.
    • Fixes automatic login events ignoring DD_USER_MODEL_LOGIN_FIELD for the reported login or using the display name as the login when DD_USER_MODEL_NAME_FIELD is configured.
    • Fixes missing user attributes on later requests when the same metadata dictionary is reused for authenticated-user tracking.
  • profiling
    • Sampled exceptions are now scaled by the sampling interval so the reported count reflects the true volume. Users will see exception rates ~sampling_interval times more than what was shown previously (default is 100)
    • Fixes an issue where asyncio.as_completed and asyncio.shield raise RuntimeError when called from synchronous code.
    • Fixes an issue where asyncio task samples are missing, or report greatly inflated wall time, on Python 3.14 patch releases other than the one ddtrace was built with.
  • fastapi
    • Fixes an issue where request span resource names and http.route tags are overwritten by a top-level catch-all route when using included routers with FastAPI 0.137 or later.
    • Fixes raw-path resource names and missing http.route tags on inner request spans when a mounted sub-application uses included routers with FastAPI 0.137 or later.
  • grpc
    • Fixes unfinished asynchronous client spans when calls are cancelled or streaming responses are not consumed.
  • django
    • Fixes an issue where enabling Interactive Application Security Testing (IAST) suppresses response header validation errors instead of allowing the application to handle them.
  • Code Security (IAST)
    • Fixes incorrect taint positions in vulnerability evidence after encoding or decoding text containing multiple tainted values.
    • Fixes missing insecure cookie findings in Runtime Code Analysis when a cookie name is passed positionally and its value is passed by keyword.
    • Fixes an issue where vulnerability reports with both redacted and non-redacted sources could omit the values of non-redacted sources or keep the values of redacted sources, depending on the order of the sources in the evidence.
    • Fixes an issue where runtime stack traces can be missing from IAST findings for requests nested under other spans, including when a parent span has already finished.
    • Fixes an issue where path traversal vulnerabilities are not reported when the path is passed by keyword, as in os.remove(path=...), shutil.copy(src=...), glob.glob(pathname=...) or tarfile.open(name=...).
    • Fixes an issue where credentials embedded in a URL with a scheme other than http or https (for example ftp://user:password@host) are not redacted in SSRF and unvalidated redirect vulnerability evidence, and improves the performance of this redaction.
    • Fixes missed vulnerability reports when custom validators receive keyword arguments.
  • Code Security
    • Fixes an issue where custom security controls configured through DD_IAST_SECURITY_CONTROLS_CONFIGURATION with the documented CMDI alias for COMMAND_INJECTION were rejected and not applied.
  • litellm
    • Fixes an issue where litellm.completion and litellm.acompletion calls using the fallbacks parameter produced two LLM Observability spans with identical token usage, double-counting tokens and cost.
    • Fixes an issue where LLM Observability does not record an LLM span for a non-streamed OpenAI chat request. This issue occurs with litellm 1.108.1 and later versions when you enable the OpenAI integration.
  • crewai, mcp, google_adk
    • Fixes an issue where spans reported datadog as the source of their service name instead of how the service name was set.
  • logging
    • Fix a TypeError raised while formatting internal product logs that carry exception information on Python 3.9.
  • internal
    • Fixes an issue where a background thread, such as the profiler's scheduler, could keep running after it was stopped shortly after a fork.
    • Fixes an issue where forking from a worker process, for example spawning a subprocess with asyncio.create_subprocess_exec on uvloop in a gunicorn worker, was delayed by up to half the Remote Configuration poll interval (2.5 seconds by default).
  • runpy
    • Fix a KeyError raised after runpy.run_module when the module was not registered in sys.modules, which also hid any error raised by the module being run.
  • SCA
    • Fixes missing or incorrect vulnerability reachability reports when multiple advisories have overlapping function targets.
  • vertexai, pydantic_ai
    • Fixes an issue where spans reported datadog as the source of their service name instead of how the service name was set.
  • kafka
    • Fixes an issue where consumer spans were missing the messaging.kafka.bootstrap.servers tag, and where consumer spans were missing kafka.cluster_id when a producer in the same process listed the same brokers in a different order or with different spacing.
  • openfeature
    • Fixes an issue where an exposure was sent to Datadog for an evaluation that a later OpenFeature after hook turned into an error.
    • Fixes an issue where provider initialization waits for the full initialization timeout when the agentless configuration source cannot start, for example when DD_API_KEY is not set for the default Datadog endpoint. Initialization now fails immediately with an error that names the cause, and flag evaluations return their default values.
    • Fixes an issue where a provider stops sending flag evaluation metrics, evaluation counts, and span enrichment after shutdown and re-initialization.
    • Fixes an issue where flag evaluations return the default value with an INVALID_CONTEXT error when an evaluation context attribute is not a str, int, float, bool or None value, for example a dict, a list or a datetime. Such attributes are now ignored: the flag returns its evaluated value instead of the default, and targeting rules that reference such an attribute treat it as absent.
  • opentelemetry
    • Fixes an issue where setting OTEL_SDK_DISABLED=true together with DD_METRICS_OTEL_ENABLED=true or DD_LOGS_OTEL_ENABLED=true still set up OpenTelemetry metrics or logs support and disabled log injection. OTEL_SDK_DISABLED=true now keeps both features disabled.
    • Fixes an issue where setting OTEL_SDK_DISABLED=false enabled OpenTelemetry traces, metrics, and logs support, and overrode OTEL_LOGS_EXPORTER=none. OTEL_SDK_DISABLED=false and an empty value are now treated as the default and no longer enable these features; use DD_TRACE_OTEL_ENABLED, DD_METRICS_OTEL_ENABLED, or DD_LOGS_OTEL_ENABLED instead.
    • Fixes an issue where comma-separated values of OTEL_TRACES_EXPORTER, OTEL_METRICS_EXPORTER and OTEL_LOGS_EXPORTER, such as otlp,zipkin, are ignored as unsupported. ddtrace still exports each signal to a single exporter, and now falls back to the supported entry of the list: otlp enables OTLP export, otherwise none disables the signal. Unsupported entries are ignored with a warning.
    • When only OTEL_EXPORTER_OTLP_ENDPOINT is set, the OTLP logs and metrics endpoints in the resolved configuration now derive from it, as the OpenTelemetry SDK exporters do, instead of defaulting to the Datadog Agent. Where logs and metrics are exported is unchanged.
  • vllm
    • Fixes distributed trace context not being propagated to vllm.request spans with vLLM >= 0.33.0 when no OTLP traces endpoint is configured, because vLLM then drops trace_headers in AsyncLLM.add_request.

Other Changes

  • perf
    • Reduces the overhead of importing ddtrace and starting instrumented applications.
    • Reduces application startup time when using ddtrace-run.
  • tracing
    • Reduces OTLP trace payload size by moving shared tracer tags to resource attributes.
  • LLM Observability
    • TypeSafe System One spans no longer include token usage in the span output, matching OpenAI Decisions API spans. Token counts are still recorded as span metrics.
  • App and API Protection
    • Updates the default WAF rules to 1.20.0, expanding detection coverage and reducing false positives for server-side template injection.