Skip to content

v5.118.0 proposal#9519

Open
dd-octo-sts[bot] wants to merge 9 commits into
v5.xfrom
v5.118.0-proposal
Open

v5.118.0 proposal#9519
dd-octo-sts[bot] wants to merge 9 commits into
v5.xfrom
v5.118.0-proposal

Conversation

@dd-octo-sts

@dd-octo-sts dd-octo-sts Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Features

  • LLM Observability: Add support for OpenAI Agents (trace-processor) #8044

Fixes

  • Feature Flags: Allow custom agentless endpoints #9481
  • General: Make peer service finalization idempotent #9364
  • LLM Observability: Llm observability traces have custom trace IDs #9460
  • standalone: Stamp _dd.apm.enabled on every span #9506
  • webpack: Opt out of typescript auto resolve #9521

BridgeAR and others added 6 commits July 24, 2026 05:58
* test: stop peer service checks racing operation spans

The shared helper started the operation before registering its trace expectation and only inspected the first span of each payload. MongoDB connection traffic could therefore consume the payload containing the expected operation span, leaving the test to time out.

* test: bind peer service checks to their operation spans

Delayed setup traces can carry the same peer-service tags as the operation under test, allowing the shared matcher to pass without observing that operation. Run each generator under a unique parent and match its child span instead.

Generator throws and invalid return values can bypass assertion cleanup. Keep the whole operation inside the cleanup boundary so the original failure is not replaced by a leaked-expectation teardown error.

* test: match peer service spans by trace

Peer-service spans can be nested below integration spans, so requiring a direct parent excluded valid operations. Match the generated trace to keep setup traffic isolated without constraining span depth.

* test: stop correlation spans delaying trace export

Keeping the correlation parent open until the operation settled delayed trace export. Integrations that publish duplicate finish notifications could then recompute `_dd.peer.service.source` before the trace was sent.

* fix(tracing): make peer service finalization idempotent

Repeated finish notifications can reach an outbound span before an ancestor lets the trace flush. The second pass treats the computed peer service as preconfigured and rewrites its source to `peer.service`; an existing source now marks finalization.

The peer-service assertion keeps its correlation parent open through completion and matches the integration component, so delayed setup traces and spans from another integration cannot satisfy it.

* test(mongodb): target bulkWrite peer service parent
…with 5 updates (#9478)

* chore(deps): bump the gh-actions-packages group across 6 directories with 5 updates

Bumps the gh-actions-packages group with 4 updates in the / directory: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/analyze](https://github.com/github/codeql-action) and [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action).
Bumps the gh-actions-packages group with 1 update in the /.github/actions/datadog-ci directory: [actions/setup-node](https://github.com/actions/setup-node).
Bumps the gh-actions-packages group with 1 update in the /.github/actions/node/setup directory: [actions/setup-node](https://github.com/actions/setup-node).
Bumps the gh-actions-packages group with 1 update in the /.github/actions/testagent/logs directory: [actions/checkout](https://github.com/actions/checkout).
Bumps the gh-actions-packages group with 1 update in the /.github/actions/testagent/start directory: [actions/checkout](https://github.com/actions/checkout).
Bumps the gh-actions-packages group with 4 updates in the /.github/workflows directory: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/analyze](https://github.com/github/codeql-action) and [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action).

Updates `actions/checkout` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@9c091bb...3d3c42e)

Updates `github/codeql-action/init` from 4.37.0 to 4.37.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@99df26d...7188fc3)

Updates `github/codeql-action/analyze` from 4.37.0 to 4.37.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@99df26d...7188fc3)

Updates `slackapi/slack-github-action` from 3.0.4 to 4.0.0
- [Release notes](https://github.com/slackapi/slack-github-action/releases)
- [Changelog](https://github.com/slackapi/slack-github-action/blob/main/CHANGELOG.md)
- [Commits](slackapi/slack-github-action@fc46ded...dcb1066)

Updates `actions/setup-node` from 6.4.0 to 7.0.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@48b55a0...8207627)

Updates `actions/setup-node` from 6.4.0 to 7.0.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@48b55a0...8207627)

Updates `actions/checkout` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@9c091bb...3d3c42e)

Updates `actions/checkout` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@9c091bb...3d3c42e)

Updates `actions/checkout` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@9c091bb...3d3c42e)

Updates `github/codeql-action/init` from 4.37.0 to 4.37.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@99df26d...7188fc3)

Updates `github/codeql-action/analyze` from 4.37.0 to 4.37.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@99df26d...7188fc3)

Updates `slackapi/slack-github-action` from 3.0.4 to 4.0.0
- [Release notes](https://github.com/slackapi/slack-github-action/releases)
- [Changelog](https://github.com/slackapi/slack-github-action/blob/main/CHANGELOG.md)
- [Commits](slackapi/slack-github-action@fc46ded...dcb1066)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gh-actions-packages
- dependency-name: github/codeql-action/init
  dependency-version: 4.37.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gh-actions-packages
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.37.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gh-actions-packages
- dependency-name: slackapi/slack-github-action
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: gh-actions-packages
- dependency-name: actions/setup-node
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: gh-actions-packages
- dependency-name: actions/setup-node
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: gh-actions-packages
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gh-actions-packages
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gh-actions-packages
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gh-actions-packages
- dependency-name: github/codeql-action/init
  dependency-version: 4.37.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gh-actions-packages
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.37.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gh-actions-packages
- dependency-name: slackapi/slack-github-action
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: gh-actions-packages
...

Signed-off-by: dependabot[bot] <support@github.com>

* attempt to fix jobs

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Hunter II <tlhunter@datadog.com>
* feat(llmobs): add OpenAI Agents trace-processor integration

* ci(llmobs): test OpenAI Agents integration
* separate llmobs trace ids

* update exportSpan

* tests

* add tagger test

* additional fixups

* update tests from rebase
* fix(openfeature): support custom agentless endpoints

* fix(openfeature): never send API keys to custom endpoints

* fix(openfeature): clarify default endpoint error
@dd-octo-sts

dd-octo-sts Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Overall package size

Self size: 7.52 MB
Deduped: 8.19 MB
No deduping: 8.19 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.2 | 124.41 kB | 440.65 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Jul 24, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 99.46%
Overall Coverage: 98.48%

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 376fc9b | Docs | Datadog PR Page | Give us feedback!

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.45652% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.48%. Comparing base (6b35e7d) to head (376fc9b).
⚠️ Report is 1922 commits behind head on v5.x.

Files with missing lines Patch % Lines
...ages/datadog-instrumentations/src/openai-agents.js 94.49% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             v5.x    #9519       +/-   ##
===========================================
+ Coverage   83.19%   98.48%   +15.29%     
===========================================
  Files         476      947      +471     
  Lines       20153   128035   +107882     
  Branches        0    10906    +10906     
===========================================
+ Hits        16766   126096   +109330     
+ Misses       3387     1939     -1448     
Flag Coverage Δ
aiguard 57.37% <48.31%> (?)
aiguard-integration 56.18% <50.87%> (?)
apm-bucket-0 58.60% <52.80%> (?)
apm-bucket-1 63.91% <52.80%> (?)
apm-bucket-2 62.67% <52.80%> (?)
apm-bucket-3 60.12% <52.80%> (?)
apm-capabilities-tracing 64.30% <34.60%> (?)
apm-integrations-aerospike 56.70% <52.80%> (?)
apm-integrations-confluentinc-kafka-javascript 61.52% <52.80%> (?)
apm-integrations-couchbase 57.06% <48.31%> (?)
apm-integrations-http 62.69% <52.80%> (?)
apm-integrations-kafkajs 62.16% <52.80%> (?)
apm-integrations-next 59.15% <48.31%> (?)
apm-integrations-prisma 58.64% <52.80%> (?)
appsec 72.83% <52.80%> (?)
appsec-express_fastify_graphql 70.32% <52.80%> (?)
appsec-integration 51.48% <45.95%> (?)
appsec-kafka_ldapjs_lodash 63.90% <52.80%> (?)
appsec-mongodb-core_mongoose_mysql 67.63% <52.80%> (?)
appsec-next 57.50% <52.80%> (?)
appsec-node-serialize_passport_postgres 67.30% <52.80%> (?)
appsec-sourcing_stripe_template 65.64% <52.80%> (?)
debugger 64.84% <52.80%> (?)
instrumentations-bucket-0 51.71% <47.19%> (?)
instrumentations-bucket-1 60.21% <48.31%> (?)
instrumentations-bucket-10 62.01% <52.80%> (?)
instrumentations-bucket-11 51.62% <47.19%> (?)
instrumentations-bucket-12 52.20% <47.19%> (?)
instrumentations-bucket-13 51.74% <47.19%> (?)
instrumentations-bucket-2 53.63% <47.19%> (?)
instrumentations-bucket-3 59.21% <48.31%> (?)
instrumentations-bucket-4 52.28% <47.19%> (?)
instrumentations-bucket-5 57.54% <52.80%> (?)
instrumentations-bucket-6 60.73% <52.80%> (?)
instrumentations-bucket-7 58.41% <52.80%> (?)
instrumentations-bucket-8 59.55% <52.80%> (?)
instrumentations-bucket-9 61.54% <48.31%> (?)
instrumentations-instrumentation-couchbase 51.02% <47.19%> (?)
instrumentations-integration-esbuild 34.32% <43.58%> (?)
llmobs-ai_anthropic_bedrock 62.78% <84.76%> (?)
llmobs-bucket-1 61.61% <80.00%> (?)
llmobs-openai 62.33% <48.99%> (?)
llmobs-openai-agents_vertex-ai 59.69% <97.53%> (?)
llmobs-sdk 65.48% <98.82%> (?)
openfeature 56.00% <50.51%> (?)
openfeature-unit 53.36% <51.54%> (?)
platform-core_esbuild_instrumentations-misc 40.64% <45.45%> (?)
platform-integration 61.35% <48.31%> (?)
platform-shimmer_unit-guardrails_webpack 39.06% <45.45%> (?)
plugins-bucket-0 57.04% <52.80%> (?)
plugins-bucket-1 54.29% <48.31%> (?)
plugins-bucket-11 62.26% <48.31%> (?)
plugins-bucket-18 61.96% <52.80%> (?)
plugins-bucket-19 60.03% <48.31%> (?)
plugins-bucket-20 62.04% <48.31%> (?)
plugins-bucket-4 58.56% <48.31%> (?)
plugins-bullmq_cassandra_cookie 61.73% <52.80%> (?)
plugins-cookie-parser_crypto_dd-trace-api 56.71% <48.31%> (?)
plugins-fetch_fs_generic-pool 58.76% <52.80%> (?)
plugins-google-cloud-pubsub_grpc_handlebars 64.67% <52.80%> (?)
plugins-hapi_hono_ioredis 60.21% <52.80%> (?)
plugins-jest_knex_langgraph 55.58% <48.31%> (?)
plugins-ldapjs_light-my-request_limitd-client 58.49% <52.80%> (?)
plugins-lodash_mariadb_memcached 58.07% <52.80%> (?)
plugins-moleculer_mongodb_mongodb-core 61.90% <52.80%> (?)
plugins-mongoose_multer_mysql 59.07% <52.80%> (?)
plugins-mysql2_nats_node-serialize 60.70% <52.80%> (?)
plugins-opensearch_passport-http_pino 59.53% <52.80%> (?)
plugins-postgres_process_pug 58.26% <52.80%> (?)
plugins-redis_router_sequelize 62.08% <52.80%> (?)
plugins-test-and-upstream-rhea_undici_url 61.62% <52.80%> (?)
plugins-valkey_vm_winston 58.00% <52.80%> (?)
plugins-ws 59.58% <48.31%> (?)
profiling 62.14% <52.80%> (?)
serverless-aws-sdk-aws-sdk 55.05% <52.80%> (?)
serverless-aws-sdk-bedrockruntime 54.75% <52.80%> (?)
serverless-aws-sdk-client 56.42% <52.80%> (?)
serverless-aws-sdk-dynamodb 55.66% <52.80%> (?)
serverless-aws-sdk-eventbridge 49.38% <47.19%> (?)
serverless-aws-sdk-kinesis 59.33% <52.80%> (?)
serverless-aws-sdk-lambda 57.38% <52.80%> (?)
serverless-aws-sdk-s3 55.75% <52.80%> (?)
serverless-aws-sdk-serverless-peer-service 59.73% <52.80%> (?)
serverless-aws-sdk-sns 60.19% <52.80%> (?)
serverless-aws-sdk-sqs 60.61% <52.80%> (?)
serverless-aws-sdk-stepfunctions 55.58% <52.80%> (?)
serverless-aws-sdk-util 51.47% <47.19%> (?)
serverless-bucket-0 54.15% <48.31%> (?)
serverless-bucket-1 59.24% <48.31%> (?)
test-optimization-cucumber 72.01% <48.31%> (?)
test-optimization-cypress 65.50% <48.31%> (?)
test-optimization-jest 73.40% <48.31%> (?)
test-optimization-mocha 73.43% <48.31%> (?)
test-optimization-playwright-playwright-atr 60.25% <48.31%> (?)
test-optimization-playwright-playwright-efd 60.49% <48.31%> (?)
test-optimization-playwright-playwright-final-status 60.46% <48.31%> (?)
test-optimization-playwright-playwright-impacted-tests 60.19% <48.31%> (?)
test-optimization-playwright-playwright-reporting 61.67% <48.31%> (?)
test-optimization-playwright-playwright-test-management 60.99% <48.31%> (?)
test-optimization-playwright-playwright-test-span 60.38% <48.31%> (?)
test-optimization-selenium 60.12% <48.31%> (?)
test-optimization-testopt 58.55% <48.31%> (?)
test-optimization-vitest 70.33% <48.31%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sabrenner
sabrenner marked this pull request as ready for review July 24, 2026 15:46
@sabrenner
sabrenner requested review from a team as code owners July 24, 2026 15:46
@sabrenner
sabrenner requested review from dd-oleksii, khanayan123, leoromanovsky, shreyamalpani and tlhunter and removed request for a team July 24, 2026 15:47

@datadog-prod-us1-5 datadog-prod-us1-5 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datadog Autotest: PASS

More details

The changed LLMObs propagation, OpenFeature endpoint, peer-service finalization, and OpenAI Agents helper paths behaved correctly across targeted normal, boundary, malformed, and propagation scenarios. The full OpenAI Agents versioned integration suite could not run because its local version fixtures are not materialized, so that path remains the main validation gap.

Was this helpful? React 👍 or 👎

📊 Validated against 10 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 9b61525 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9b61525319

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

if (!traceId) return

const name = oaiTrace.name || 'Agent workflow'
const ddSpan = this.#tracer.startSpan(name, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve active parent for agent workflows

When an agent run is started inside an existing Datadog span, such as an HTTP request handler, this direct startSpan() call creates the workflow as a new root because dd-trace only uses a parent when childOf/references are provided. The child agent and openai.request spans then form a separate trace, so the agent work no longer appears under the request that triggered it; pass the currently active span as the workflow parent.

Useful? React with 👍 / 👎.

handoff: 'tool',
guardrail: 'task',
custom: 'task',
response: 'llm',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Trace generation spans from chat-completions agents

When users configure the Agents SDK to use Chat Completions (setOpenAIAPI('chat_completions') or OpenAIChatCompletionsModel), the SDK reports the LLM call as a generation span rather than a response span. Since this mapping only treats response as an LLM span, onSpanStart() drops those model calls, so chat-completions agents lose their LLM/APM span and LLMObs input/output tagging even though the integration advertises @openai/agents support.

Useful? React with 👍 / 👎.

let content = ''
if (Array.isArray(item.content)) {
const textParts = item.content
.filter(c => c.type === 'input_text' || c.type === 'text')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve non-text agent input parts

When an Agents run sends Responses API message content with images or files, this filter keeps only text parts and drops every non-text part before tagging the LLM span and workflow input. A multimodal prompt can therefore be recorded as incomplete or even as an empty user message, so LLMObs no longer reflects the actual model input; include placeholders or structured handling for image/file parts instead of filtering them out.

Useful? React with 👍 / 👎.


constructor ({ tracer, config } = {}) {
this.#tracer = tracer
this.#tagger = config?.llmobs?.DD_LLMOBS_ENABLED ? new LLMObsTagger(config, true) : undefined

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Create LLMObs tagger for late enablement

When @openai/agents is loaded before tracer.llmobs.enable(), this one-time check leaves #tagger undefined because DD_LLMOBS_ENABLED is still false at plugin construction. A later programmatic enable flips the shared config and starts the writers, but every openai-agents LLMObs path is guarded by this.#tagger, so this integration keeps emitting only APM spans; create the tagger unconditionally or lazily when LLMObs becomes enabled.

Useful? React with 👍 / 👎.

const parentSpan = this.#resolveParent(oaiSpan)
const spanName = deriveSpanName(oaiSpan)

const ddSpan = this.#tracer.startSpan(spanName, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Activate tool spans while user tools run

When a function tool does instrumented work such as HTTP or database calls, this startSpan() only creates the tool span with childOf; it never makes that span active for the duration of the agents-core span. Since the plugin only binds scope around model response calls, downstream spans emitted from user tool execution inherit the prior active span instead of the function tool span, breaking the trace hierarchy for tool internals.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9b61525319

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

if (!traceId) return

const name = oaiTrace.name || 'Agent workflow'
const ddSpan = this.#tracer.startSpan(name, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve active parent for agent workflows

When an agent run is started inside an existing Datadog span, such as an HTTP request handler, this direct startSpan() call creates the workflow as a new root because dd-trace only uses a parent when childOf/references are provided. The child agent and openai.request spans then form a separate trace, so the agent work no longer appears under the request that triggered it; pass the currently active span as the workflow parent.

Useful? React with 👍 / 👎.

handoff: 'tool',
guardrail: 'task',
custom: 'task',
response: 'llm',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Trace generation spans from chat-completions agents

When users configure the Agents SDK to use Chat Completions (setOpenAIAPI('chat_completions') or OpenAIChatCompletionsModel), the SDK reports the LLM call as a generation span rather than a response span. Since this mapping only treats response as an LLM span, onSpanStart() drops those model calls, so chat-completions agents lose their LLM/APM span and LLMObs input/output tagging even though the integration advertises @openai/agents support.

Useful? React with 👍 / 👎.

let content = ''
if (Array.isArray(item.content)) {
const textParts = item.content
.filter(c => c.type === 'input_text' || c.type === 'text')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve non-text agent input parts

When an Agents run sends Responses API message content with images or files, this filter keeps only text parts and drops every non-text part before tagging the LLM span and workflow input. A multimodal prompt can therefore be recorded as incomplete or even as an empty user message, so LLMObs no longer reflects the actual model input; include placeholders or structured handling for image/file parts instead of filtering them out.

Useful? React with 👍 / 👎.


constructor ({ tracer, config } = {}) {
this.#tracer = tracer
this.#tagger = config?.llmobs?.DD_LLMOBS_ENABLED ? new LLMObsTagger(config, true) : undefined

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Create LLMObs tagger for late enablement

When @openai/agents is loaded before tracer.llmobs.enable(), this one-time check leaves #tagger undefined because DD_LLMOBS_ENABLED is still false at plugin construction. A later programmatic enable flips the shared config and starts the writers, but every openai-agents LLMObs path is guarded by this.#tagger, so this integration keeps emitting only APM spans; create the tagger unconditionally or lazily when LLMObs becomes enabled.

Useful? React with 👍 / 👎.

const parentSpan = this.#resolveParent(oaiSpan)
const spanName = deriveSpanName(oaiSpan)

const ddSpan = this.#tracer.startSpan(spanName, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Activate tool spans while user tools run

When a function tool does instrumented work such as HTTP or database calls, this startSpan() only creates the tool span with childOf; it never makes that span active for the duration of the agents-core span. Since the plugin only binds scope around model response calls, downstream spans emitted from user tool execution inherit the prior active span instead of the function tool span, breaking the trace hierarchy for tool internals.

Useful? React with 👍 / 👎.

@dd-octo-sts
dd-octo-sts Bot force-pushed the v5.118.0-proposal branch from 9b61525 to 376fc9b Compare July 24, 2026 16:29
@pr-commenter

pr-commenter Bot commented Jul 24, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-24 16:46:37

Comparing candidate commit 376fc9b in PR branch v5.118.0-proposal with baseline commit 9c6a17b in branch v5.x.

📊 Benchmarking dashboard

Found 3 performance improvements and 0 performance regressions! Performance is the same for 2313 metrics, 42 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:llmobs-span-processor-agent-26

  • 🟩 cpu_user_time [-486.952ms; -195.344ms] or [-12.101%; -4.855%]
  • 🟩 execution_time [-513.701ms; -206.450ms] or [-12.308%; -4.946%]
  • 🟩 throughput [+11257.485op/s; +28320.853op/s] or [+4.893%; +12.311%]

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-20

  • unstable execution_time [-221.084ms; +228.545ms] or [-5.912%; +6.112%]

scenario:appsec-appsec-enabled-24

  • unstable execution_time [-211.860ms; +209.102ms] or [-7.928%; +7.825%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-233.585ms; +238.223ms] or [-9.092%; +9.272%]

scenario:appsec-appsec-enabled-with-attacks-24

  • unstable execution_time [-165.124ms; +155.399ms] or [-5.343%; +5.028%]

scenario:appsec-appsec-enabled-with-attacks-26

  • unstable execution_time [-186.822ms; +193.929ms] or [-6.418%; +6.662%]

scenario:appsec-control-20

  • unstable execution_time [-179.590ms; +186.078ms] or [-10.041%; +10.404%]

scenario:appsec-control-24

  • unstable execution_time [-114942.254µs; +115637.021µs] or [-9.246%; +9.302%]

scenario:appsec-control-26

  • unstable execution_time [-127488.957µs; +128123.524µs] or [-10.256%; +10.307%]

scenario:child_process-shell-string-24

  • unstable execution_time [-18.793ms; +25.616ms] or [-5.753%; +7.842%]
  • unstable throughput [-224755.154op/s; +214636.708op/s] or [-6.259%; +5.977%]

scenario:debugger-line-probe-with-snapshot-minimal-24

  • unstable cpu_user_time [-1639.495ms; +586.794ms] or [-20.007%; +7.161%]
  • unstable execution_time [-1666.770ms; +588.702ms] or [-18.735%; +6.617%]
  • unstable instructions [-14.2G instructions; +4.8G instructions] or [-21.248%; +7.261%]
  • unstable throughput [-177.895op/s; +465.464op/s] or [-4.809%; +12.583%]

scenario:debugger-line-probe-without-snapshot-24

  • unstable cpu_user_time [-1742.999ms; +2750.492ms] or [-21.292%; +33.599%]
  • unstable execution_time [-1772.088ms; +2768.681ms] or [-19.918%; +31.120%]
  • unstable instructions [-15.0G instructions; +23.6G instructions] or [-22.354%; +35.287%]
  • unstable max_rss_usage [-7.440MB; +11.484MB] or [-4.724%; +7.292%]
  • unstable throughput [-780.828op/s; +505.952op/s] or [-21.199%; +13.736%]

scenario:debugger-line-probe-without-snapshot-26

  • unstable cpu_user_time [-3225.401ms; +2923.067ms] or [-31.767%; +28.789%]
  • unstable execution_time [-3256.904ms; +2911.746ms] or [-29.830%; +26.669%]
  • unstable instructions [-28.6G instructions; +25.9G instructions] or [-33.599%; +30.426%]
  • unstable max_rss_usage [-10055.016KB; +10419.816KB] or [-6.240%; +6.466%]
  • unstable throughput [-626.508op/s; +680.294op/s] or [-20.301%; +22.044%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-430.731ms; +277.423ms] or [-8.515%; +5.484%]
  • unstable execution_time [-432.009ms; +272.597ms] or [-8.424%; +5.315%]
  • unstable throughput [-95387.392op/s; +145296.563op/s] or [-5.824%; +8.871%]

scenario:plugin-aws-sdk-lambda-inject-with-context-24

  • unstable cpu_user_time [-216.449ms; +186.184ms] or [-5.637%; +4.849%]
  • unstable execution_time [-217.116ms; +185.454ms] or [-5.618%; +4.798%]

scenario:plugin-claude-agent-sdk-compact-stream-scan-26

  • unstable cpu_usage_percentage [-9.004%; +6.055%]
  • unstable execution_time [-3346.055µs; +3536.073µs] or [-5.435%; +5.744%]
  • unstable throughput [-27965.783op/s; +30572.558op/s] or [-5.073%; +5.546%]

scenario:plugin-graphql-long-with-depth-and-collapse-off-20

  • unstable max_rss_usage [-20.624MB; +32.632MB] or [-5.303%; +8.391%]

scenario:plugin-graphql-long-with-depth-off-26

  • unstable max_rss_usage [-26.502MB; +15.845MB] or [-11.855%; +7.087%]

scenario:plugin-graphql-long-with-depth-on-max-20

  • unstable execution_time [-601.614ms; +589.129ms] or [-5.098%; +4.993%]
  • unstable throughput [-3.435op/s; +3.490op/s] or [-5.038%; +5.118%]

scenario:plugin-pg-service-24

  • unstable cpu_usage_percentage [-8.342%; +5.119%]
  • unstable execution_time [-135.768ms; +202.935ms] or [-7.958%; +11.896%]
  • unstable throughput [-301613.336op/s; +206127.463op/s] or [-8.476%; +5.793%]

scenario:sampling-agent-24

  • unstable cpu_user_time [-180.046ms; +286.369ms] or [-7.327%; +11.654%]
  • unstable execution_time [-190.481ms; +305.062ms] or [-7.735%; +12.389%]
  • unstable throughput [-408836.892op/s; +254929.758op/s] or [-8.295%; +5.172%]

@leoromanovsky leoromanovsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ffe lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants