Skip to content

fix(tracer): honor explicit false error tags - #10084

Open
BridgeAR wants to merge 2 commits into
masterfrom
BridgeAR/2026-08-31-5226-audit
Open

fix(tracer): honor explicit false error tags#10084
BridgeAR wants to merge 2 commits into
masterfrom
BridgeAR/2026-08-31-5226-audit

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

When a traced callback rejected or threw after setting error to false, automatic error metadata was added after the callback. The formatter then marked the span as failed again.

A final literal error: false now keeps the exception metadata but suppresses error classification for that span. The exception still propagates.

Fixes: #5226

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
@BridgeAR
BridgeAR marked this pull request as ready for review August 31, 2026 19:23
@BridgeAR
BridgeAR requested review from a team as code owners August 31, 2026 19:23
@dd-octo-sts

dd-octo-sts Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 8.63 MB
Deduped: 9.3 MB
No deduping: 9.3 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

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Aug 31, 2026

Copy link
Copy Markdown

Pipelines  Tests

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 1 Pipeline job failed

DataDog/apm-reliability/dd-trace-js | benchmark: [20, 1]

View more details · View in GitLab

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 98.63% (+0.00%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 6022dea | Docs | View more details | Give us feedback!

@pr-commenter

pr-commenter Bot commented Aug 31, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-31 19:34:59

Comparing candidate commit 5b6c361 in PR branch BridgeAR/2026-08-31-5226-audit with baseline commit cb5fac7 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2302 metrics, 8 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 ----------------------------------'

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 max_rss_usage [-28.578MB; +4.121MB] or [-15.635%; +2.255%]

scenario:appsec-iast-with-vulnerability-iast-enabled-default-config-20

  • unstable max_rss_usage [-24.767MB; +19.317MB] or [-6.509%; +5.077%]

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

  • unstable max_rss_usage [-15.155MB; +11.747MB] or [-6.036%; +4.679%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-256.843ms; +408.816ms] or [-5.274%; +8.395%]
  • unstable execution_time [-250.011ms; +410.297ms] or [-5.049%; +8.286%]
  • unstable throughput [-137110.149op/s; +82583.396op/s] or [-8.095%; +4.876%]

scenario:llmobs-encode-unicode-mixed-20

  • unstable max_rss_usage [-7581.764KB; +7481.764KB] or [-9.539%; +9.413%]

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

  • unstable max_rss_usage [-8.495MB; +6.197MB] or [-6.041%; +4.407%]

@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: 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) {

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 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

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.62%. Comparing base (fcb872a) to head (6022dea).
⚠️ Report is 1 commits behind head on master.

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            
Flag Coverage Δ
aiguard 63.13% <100.00%> (-0.03%) ⬇️
aiguard-integration 58.99% <100.00%> (ø)
apm-bucket-0 62.49% <100.00%> (-0.03%) ⬇️
apm-bucket-1 67.93% <100.00%> (-0.03%) ⬇️
apm-bucket-2 67.49% <100.00%> (-0.03%) ⬇️
apm-bucket-3 64.34% <100.00%> (-0.03%) ⬇️
apm-capabilities-tracing 62.56% <100.00%> (ø)
apm-integrations-aerospike 60.50% <100.00%> (-0.03%) ⬇️
apm-integrations-confluentinc-kafka-javascript 66.58% <100.00%> (-0.03%) ⬇️
apm-integrations-couchbase 61.02% <100.00%> (-0.03%) ⬇️
apm-integrations-http 66.21% <100.00%> (-0.03%) ⬇️
apm-integrations-kafkajs 67.20% <100.00%> (-0.03%) ⬇️
apm-integrations-next 63.83% <100.00%> (-0.03%) ⬇️
apm-integrations-prisma 61.88% <100.00%> (-0.03%) ⬇️
appsec 76.72% <100.00%> (-0.02%) ⬇️
appsec-express_fastify_graphql 72.68% <100.00%> (-0.02%) ⬇️
appsec-integration 49.52% <100.00%> (ø)
appsec-kafka_ldapjs_lodash 67.47% <100.00%> (+<0.01%) ⬆️
appsec-mongodb-core_mongoose_mysql 70.63% <100.00%> (-0.02%) ⬇️
appsec-next 57.11% <100.00%> (-0.02%) ⬇️
appsec-node-serialize_passport_postgres 70.09% <100.00%> (-0.02%) ⬇️
appsec-sourcing_stripe_template 68.52% <100.00%> (-0.02%) ⬇️
debugger 69.07% <100.00%> (-0.03%) ⬇️
instrumentations-bucket-0 56.07% <0.00%> (-0.03%) ⬇️
instrumentations-bucket-1 64.16% <100.00%> (-0.03%) ⬇️
instrumentations-bucket-10 53.29% <0.00%> (-0.03%) ⬇️
instrumentations-bucket-11 65.61% <100.00%> (-0.03%) ⬇️
instrumentations-bucket-12 61.38% <100.00%> (-0.03%) ⬇️
instrumentations-bucket-13 56.27% <0.00%> (-0.03%) ⬇️
instrumentations-bucket-14 55.72% <0.00%> (-0.03%) ⬇️
instrumentations-bucket-2 56.92% <0.00%> (-0.03%) ⬇️
instrumentations-bucket-3 57.12% <0.00%> (-0.03%) ⬇️
instrumentations-bucket-4 63.77% <100.00%> (-0.03%) ⬇️
instrumentations-bucket-5 56.52% <0.00%> (-0.03%) ⬇️
instrumentations-bucket-6 58.11% <100.00%> (-0.02%) ⬇️
instrumentations-bucket-7 65.65% <100.00%> (-0.03%) ⬇️
instrumentations-bucket-8 62.91% <100.00%> (-0.04%) ⬇️
instrumentations-bucket-9 64.50% <100.00%> (-0.03%) ⬇️
instrumentations-instrumentation-couchbase 54.68% <0.00%> (-0.03%) ⬇️
instrumentations-instrumentation-zlib 55.75% <0.00%> (-0.03%) ⬇️
instrumentations-integration-esbuild 34.50% <0.00%> (ø)
llmobs-ai_anthropic_bedrock 66.67% <100.00%> (-0.02%) ⬇️
llmobs-bucket-1 64.84% <100.00%> (-0.02%) ⬇️
llmobs-openai 66.68% <100.00%> (-0.03%) ⬇️
llmobs-openai-agents_vertex-ai 63.97% <100.00%> (-0.02%) ⬇️
llmobs-sdk 75.90% <100.00%> (-0.03%) ⬇️
master-coverage 98.62% <100.00%> (?)
openfeature 59.57% <0.00%> (-0.01%) ⬇️
openfeature-unit 58.26% <0.00%> (-0.03%) ⬇️
platform-core_esbuild_instrumentations-misc 41.07% <0.00%> (-0.02%) ⬇️
platform-integration 64.80% <100.00%> (ø)
platform-shimmer_unit-guardrails_webpack 38.90% <0.00%> (-0.02%) ⬇️
plugins-browser-bunyan_bullmq_cassandra 66.22% <100.00%> (-0.03%) ⬇️
plugins-bucket-0 60.91% <100.00%> (-0.03%) ⬇️
plugins-bucket-1 58.14% <0.00%> (ø)
plugins-bucket-11 67.67% <100.00%> (-0.03%) ⬇️
plugins-bucket-18 65.43% <100.00%> (-0.03%) ⬇️
plugins-bucket-19 64.91% <100.00%> (-0.04%) ⬇️
plugins-bucket-20 68.63% <100.00%> (-0.03%) ⬇️
plugins-bucket-4 61.07% <100.00%> (-0.03%) ⬇️
plugins-cookie_cookie-parser_crypto 55.66% <0.00%> (-0.03%) ⬇️
plugins-fastify_fetch_fs 65.35% <100.00%> (+<0.01%) ⬆️
plugins-generic-pool_google-cloud-pubsub_grpc 68.92% <100.00%> (-0.03%) ⬇️
plugins-handlebars_hapi_hono 63.58% <100.00%> (-0.03%) ⬇️
plugins-ioredis_knex_langgraph 61.59% <100.00%> (-0.03%) ⬇️
plugins-ldapjs_light-my-request_limitd-client 63.29% <100.00%> (-0.03%) ⬇️
plugins-lodash_mariadb_memcached 63.68% <100.00%> (-0.03%) ⬇️
plugins-moleculer_mongodb_mongodb-core 66.03% <100.00%> (-0.03%) ⬇️
plugins-mongoose_multer_mysql 63.88% <100.00%> (-0.03%) ⬇️
plugins-mysql2_nats_node-serialize 66.10% <100.00%> (-0.03%) ⬇️
plugins-opensearch_passport-http_pino 63.99% <100.00%> (-0.03%) ⬇️
plugins-postgres_process_pug 63.03% <100.00%> (-0.03%) ⬇️
plugins-redis_router_sequelize 66.60% <100.00%> (-0.03%) ⬇️
plugins-test-and-upstream-rhea_undici_url 65.95% <100.00%> (-0.03%) ⬇️
plugins-valkey_vm_winston 62.35% <100.00%> (-0.03%) ⬇️
plugins-ws 64.42% <100.00%> (-0.03%) ⬇️
profiling 66.18% <100.00%> (-0.03%) ⬇️
serverless-aws-sdk-aws-sdk 55.40% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-base-inject-field 55.23% <0.00%> (-0.03%) ⬇️
serverless-aws-sdk-bedrockruntime 58.25% <100.00%> (-0.03%) ⬇️
serverless-aws-sdk-client 60.03% <100.00%> (-0.03%) ⬇️
serverless-aws-sdk-dynamodb 59.12% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-eventbridge 57.61% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-kinesis 63.09% <100.00%> (-0.03%) ⬇️
serverless-aws-sdk-lambda 61.05% <100.00%> (-0.03%) ⬇️
serverless-aws-sdk-s3 59.16% <100.00%> (-0.03%) ⬇️
serverless-aws-sdk-serverless-peer-service 63.66% <100.00%> (-0.03%) ⬇️
serverless-aws-sdk-sns 63.98% <100.00%> (-0.03%) ⬇️
serverless-aws-sdk-sqs 64.43% <100.00%> (-0.03%) ⬇️
serverless-aws-sdk-stepfunctions 59.02% <100.00%> (-0.03%) ⬇️
serverless-aws-sdk-util 55.85% <0.00%> (-0.03%) ⬇️
serverless-bucket-0 57.77% <0.00%> (-0.01%) ⬇️
serverless-bucket-1 63.66% <100.00%> (-0.03%) ⬇️
test-optimization-cucumber 70.51% <100.00%> (+0.02%) ⬆️
test-optimization-cypress 64.72% <0.00%> (+0.05%) ⬆️
test-optimization-jest 72.05% <100.00%> (+<0.01%) ⬆️
test-optimization-mocha 71.95% <100.00%> (+0.05%) ⬆️
test-optimization-playwright-playwright-atr 59.77% <0.00%> (-0.04%) ⬇️
test-optimization-playwright-playwright-efd 60.40% <0.00%> (-0.04%) ⬇️
test-optimization-playwright-playwright-final-status 60.02% <0.00%> (-0.04%) ⬇️
test-optimization-playwright-playwright-impacted-tests 60.13% <0.00%> (-0.04%) ⬇️
test-optimization-playwright-playwright-reporting 61.10% <0.00%> (-0.04%) ⬇️
test-optimization-playwright-playwright-test-management 61.19% <0.00%> (-0.04%) ⬇️
test-optimization-playwright-playwright-test-span 59.82% <0.00%> (+0.01%) ⬆️
test-optimization-selenium 58.84% <100.00%> (-0.07%) ⬇️
test-optimization-testopt 61.78% <0.00%> (+0.06%) ⬆️
test-optimization-vitest 72.66% <100.00%> (+0.08%) ⬆️
test-optimization-vitest-browser 58.68% <0.00%> (-0.03%) ⬇️
test-optimization-webdriverio 65.48% <0.00%> (+0.04%) ⬆️

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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Trace is marked as error even despite tagging trace as error false

1 participant