fix(tracer): honor explicit false error tags - #10084
Conversation
Rejected or thrown traced work adds standard error metadata after the callback returns. The formatter treated that metadata as a fresh failure, so it overrode a final error: false decision. Fixes: #5226
Overall package sizeSelf size: 8.63 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.4.0 | 127.33 kB | 447.04 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 |
|
BenchmarksBenchmark execution time: 2026-08-31 19:34:59 Comparing candidate commit 5b6c361 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2302 metrics, 8 unstable metrics.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6022deab08
ℹ️ 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 (context._name === 'fs.operation') break | ||
| // otel.recordException should not influence trace.error | ||
| if (!tags[IGNORE_OTEL_ERROR]) { | ||
| if (!tags[IGNORE_OTEL_ERROR] && tags.error !== false) { |
There was a problem hiding this comment.
Let an OTel ERROR status override the attribute
When an OpenTelemetry bridge span has setAttribute('error', false) (or the equivalent initial attribute) and later calls setStatus({ code: SpanStatusCode.ERROR }), this condition leaves the exported span's error field at 0. The OTel status path deliberately writes IGNORE_OTEL_ERROR = false in span-helpers.js:278-282 to make its error metadata mark the span as failed, but this new conjunction discards that signal; treat an explicit false sentinel as authoritative and consult error: false only when that sentinel is absent. This sibling path also needs coverage alongside the native-tracer regression test.
AGENTS.md reference: AGENTS.md:L79-L79
Useful? React with 👍 / 👎.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10084 +/- ##
========================================
Coverage 98.62% 98.62%
========================================
Files 996 996
Lines 152028 152028
Branches 12625 13492 +867
========================================
Hits 149941 149941
Misses 2087 2087
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:
|
When a traced callback rejected or threw after setting
errortofalse, automatic error metadata was added after the callback. The formatter then marked the span as failed again.A final literal
error: falsenow keeps the exception metadata but suppresses error classification for that span. The exception still propagates.Fixes: #5226