Conversation
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. |
Overall package sizeSelf size: 8.99 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f2d04e8281
ℹ️ 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".
BenchmarksBenchmark execution time: 2026-09-18 20:55:44 Comparing candidate commit 29f88d7 in PR branch Found 0 performance improvements and 3 performance regressions! Performance is the same for 2297 metrics, 13 unstable metrics.
|
|
✅ All CI checks and tests passed. Datadog automation helped this PR pass. 🎉 All green!🧪 All tests passed 🔄 Datadog retried 1 test - 1 passed on retry 🎯 Code Coverage (details) 🔗 Commit SHA: 29f88d7 | Docs | View more details | Give us feedback! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10086 +/- ##
=======================================
Coverage 98.74% 98.75%
=======================================
Files 1029 1029
Lines 161207 161233 +26
Branches 74 74
=======================================
+ Hits 159188 159226 +38
+ Misses 2019 2007 -12
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:
|
7216079 to
b19bdae
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29f88d759b
ℹ️ 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".
| dataPoint.startTimeUnixNano = lastState?.timeUnixNano ?? | ||
| dataPoint.startTimeUnixNano ?? dataPoint.timeUnixNano |
There was a problem hiding this comment.
Seed the first observable delta window before collection
When an ObservableCounter uses DELTA temporality, #aggregateLastValue provides no startTimeUnixNano, so its first collection takes this final fallback after timeUnixNano has already been overwritten with collectionTime. The exported point therefore has startTimeUnixNano === timeUnixNano while containing the entire initial observed value, producing a zero-duration delta window that receivers may reject or cannot use for rate calculations. Initialize first-seen observable series from an earlier boundary such as the aggregator start, and cover this sibling of the synchronous counter path in the new timestamp test.
AGENTS.md reference: AGENTS.md:L79-L80
Useful? React with 👍 / 👎.
What does this PR do?
Prevents overlapping OTLP delta metric windows in the TraceMetrics and general metrics exporters.
For
traces.span.sdk.metrics.duration, span statistics now use continuous process-relative collection windows instead of fixed wall-clock buckets. A periodic flush closes the current window at collection time. A force flush closes the partial window and refreshes the timer so the next periodic window receives a full interval. Empty windows advance the boundary without emitting a metric payload.For general delta counters and histograms, each point ends at collection time and that endpoint becomes the next point start. Counts, sums, and histogram buckets are unchanged.
Motivation
The previous wall-clock buckets could be drained before completion and then recreated by later spans, producing overlapping delta histogram points. Force flushes could trigger the same overlap in reused serverless processes.
Collection-relative windows remain continuous across periodic and force flushes without requiring ten-second wall-clock alignment.
Performance
This change does not add metric series or payloads. Span metrics emit at most one non-empty window per flush, empty windows are not exported, and refreshing the timer after force flush avoids an additional scheduled export. The OTLP span hot path also avoids wall-clock timestamp and modulo calculations.
Testing
./node_modules/.bin/mocha packages/dd-trace/test/span_stats.spec.js packages/dd-trace/test/opentelemetry/metrics/otlp_span_stats_transformer.spec.js packages/dd-trace/test/opentelemetry/metrics/otlp_span_stats_exporter.spec.js packages/dd-trace/test/opentelemetry/metrics.spec.js./node_modules/.bin/eslint packages/dd-trace/src/span_stats.js packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_transformer.js packages/dd-trace/test/span_stats.spec.js packages/dd-trace/test/opentelemetry/metrics/otlp_span_stats_transformer.spec.js --max-warnings 0git diff --check