Repository navigation
fix(id): reset agentless exporter identity state - #10342
Conversation
Overall package sizeSelf size: 8.97 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.5.1 | 127.66 kB | 513.61 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✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## tianning.li/microvm-buffer-reset-01-common-exporter-agent-spanstats-reset-and-cancel #10342 +/- ##
=========================================================================================================================
- Coverage 98.74% 81.29% -17.46%
=========================================================================================================================
Files 1029 1006 -23
Lines 161396 154901 -6495
Branches 74 74
=========================================================================================================================
- Hits 159374 125927 -33447
- Misses 2022 28974 +26952
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:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🔵 Needs a closer look
This is a draft, stacked identity-refresh change requiring final human review.
Pull request overview
Resets agent and agentless exporter state during MicroVM identity refreshes to prevent stale buffered data.
Changes:
- Adds identity-refresh handling for both exporters.
- Resets pending writer batches.
- Adds focused refresh tests.
File summaries
| File | Summary |
|---|---|
packages/dd-trace/test/exporters/agentless/exporter.spec.js |
Tests agentless exporter refresh handling. |
packages/dd-trace/test/exporters/agent/exporter.spec.js |
Tests agent exporter refresh handling. |
packages/dd-trace/src/exporters/agentless/index.js |
Resets agentless writer state on identity refresh. |
packages/dd-trace/src/exporters/agent/index.js |
Resets agent writer state on identity refresh; separates the dc-polyfill third-party import group. |
Review details
Suppressed comments (1)
packages/dd-trace/src/exporters/agent/index.js:4
- Please keep the new
dc-polyfilldependency in its own third-party import group, separated from the Node core and internal imports. The neighboring exporter/common/writer.js:3-9 and this file's agentless counterpart use that grouping, and the current placement makes the import ordering inconsistent with the repository convention.
const { channel } = require('dc-polyfill')
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b44ea439dc
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
The agentless exporter keeps an active libdatadog request or retry after identity refresh. A restored MicroVM clone can send the old payload again.
🤖 Datadog Autotest · Commit b44ea43 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 9ce96e0 | Docs | View more details | Give us feedback! |
BenchmarksBenchmark execution time: 2026-09-18 21:18:17 Comparing candidate commit 9ce96e0 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2303 metrics, 10 unstable metrics.
|
ddfd268 to
6252560
Compare
3a669af to
56feaba
Compare
84d4715 to
131286c
Compare
56feaba to
125a469
Compare
There was a problem hiding this comment.
More details
The child finding refers to telemetry retry logic that this PR does not change. It does not meet the changed-line rule.
🤖 Datadog Autotest · Commit 56feaba · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
56806c4 to
dda557a
Compare
125a469 to
9ce96e0
Compare
What does this PR do?
Reset trace exporter state when an AWS Lambda MicroVM refreshes its identity. A snapshot can contain buffered spans or an in-flight delivery; restoring that snapshot must not resend the old payload under the clone's new runtime identity.
This PR is the second step in the stacked breakdown of PR #9814, tracked by SVLS-9768.
Changes
datadog:identity:refresh.Agentless exporter lifecycle
A refresh closes the current private libdatadog exporter; it does not create a replacement during the reset. The writer clears its cached exporter and configuration fields, then clears the encoded batch.
The next post-refresh flush that has data calls
AgentlessWriter._sendPayload(). Its configuration check sees that no pipeline exporter exists and creates one with the current runtime ID, environment, API key, and endpoint. An empty flush does not recreate the exporter.Dependency tree
origin/master01-common-exporter-agent-spanstats-reset-and-cancel02-agentless-exporter-identity← current PR06-datastream-reset-and-cancel03-dogstatsd-buffer-reset04-otel-runtime-baseline05-otel-runtime-metric-resetsThis PR is part of the stacked review sequence above.