v6.7.0 proposal#9518
Conversation
* 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
Overall package sizeSelf size: 7.52 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 |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v6.x #9518 +/- ##
=======================================
Coverage ? 98.44%
=======================================
Files ? 947
Lines ? 128035
Branches ? 10927
=======================================
Hits ? 126047
Misses ? 1988
Partials ? 0 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-07-24 06:14:06 Comparing candidate commit 60f26cf in PR branch Found 4 performance improvements and 0 performance regressions! Performance is the same for 2310 metrics, 44 unstable metrics.
|
There was a problem hiding this comment.
The new OpenAI Agents LLMObs extraction assumes every Responses array entry is a non-null object. A malformed or partially populated response can therefore throw during annotation and silently lose the LLMObs event, although the surrounding processor prevents the exception from reaching the application.
📊 Validated against 12 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 60f26cf · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
| messages.push({ role: 'user', content: input }) | ||
| } else if (Array.isArray(input)) { | ||
| for (const item of input) { | ||
| if (item.type === 'message') { |
There was a problem hiding this comment.
Null Responses items throw during LLMObs extraction
Malformed or forward-compatible Responses payloads lose LLMObs input/output telemetry for the affected model call.
Assertion details
- Input: An OpenAI Agents response or request input contains a null/undefined item in its Responses array, such as output: [null] or input: [null].
- Expected:
The instrumentation should ignore malformed array entries or emit a safe placeholder while preserving the APM span and LLMObs event. - Actual:
extractInputMessages and extractOutputMessages dereference item.type without checking item. Direct execution with [null] and [undefined] throws TypeError. DDOpenAIAgentsProcessor catches the exception in onSpanEnd, so the application continues but the LLMObs span is emitted without the intended I/O annotation or may be dropped from processing.
Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60f26cf7fc
ℹ️ 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, { |
There was a problem hiding this comment.
Parent the workflow span to the active trace
When an agent run happens inside an already traced request or job, this startSpan call has no childOf, and DatadogTracer.startSpan() only parents from options.childOf/references. That makes the new Agent workflow span start a separate root trace, so the agent/LLM spans are disconnected from the request trace even though the run happened within it. Use the active legacy/current scope span as the workflow parent when one exists.
Useful? React with 👍 / 👎.
| tags: { | ||
| component: COMPONENT, | ||
| 'span.kind': KIND_TO_SPAN_KIND[llmobsKind] ?? 'internal', | ||
| }, |
There was a problem hiding this comment.
Honor OpenAI Agents service overrides
When users configure tracer.use('openai-agents', { service: '...' }) or DD_SERVICE_MAPPING, this plugin's configure() receives config.service, but it only forwards enabled, and these raw tracer.startSpan calls only set component/span.kind. Unlike TracingPlugin.startSpan, nothing writes service.name, so the new workflow/agent/LLM/tool spans are reported under the global service instead of the configured integration service.
Useful? React with 👍 / 👎.
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| - uses: ./.github/actions/testagent/start | ||
| - uses: ./.github/actions/node/oldest-maintenance-lts |
There was a problem hiding this comment.
Run OpenAI Agents tests on supported Node
In this new job, oldest-maintenance-lts resolves to Node 18 in .github/actions/node/setup/action.yml, but the @openai/agents SDK documents support as Node.js 22 or later (README). Because the openai-agents externals do not declare a node: '>=22' floor, the first install/test leg runs these packages on an unsupported runtime and can fail the LLMObs workflow before the plugin is exercised; run this job on active/latest or add a Node floor to the externals.
Useful? React with 👍 / 👎.
| // Model name only arrives with the response; tagged in | ||
| // `#setResponseAttributes` once known. Model provider is resolved from | ||
| // the agents-openai client's baseURL captured at getResponse time. | ||
| llmobsOptions.modelProvider = this.#modelProvider |
There was a problem hiding this comment.
Keep the provider with each streamed response
For streamed responses, publishClientBaseURL() runs when the async iterator is created, but the OpenAI Agents response span is not started until the iterator is advanced. If an app creates streams for different base URLs before consuming the first one, this singleton #modelProvider can be overwritten by the later stream, so the earlier LLMObs span is tagged with the wrong provider. Store the provider per model call/span instead of reading the last process-wide value here.
Useful? React with 👍 / 👎.
Features
Fixes