Skip to content

fix(electron): skip extraction without IPC carrier - #10041

Open
LotharSee wants to merge 1 commit into
masterfrom
bfernandes/fix-electron-ipc-missing-carrier
Open

fix(electron): skip extraction without IPC carrier#10041
LotharSee wants to merge 1 commit into
masterfrom
bfernandes/fix-electron-ipc-missing-carrier

Conversation

@LotharSee

Copy link
Copy Markdown

What does this PR do?

Avoids calling tracer.extract() when Electron renderer IPC does not include a propagation carrier. The receive span is still created as a root span for uninstrumented renderer messages.

Adds a regression test that sends an uninstrumented ipcRenderer.postMessage() through the real Electron IPC path and verifies that extraction is not attempted with undefined.

Motivation

Electron IPC messages can arrive without the carrier appended by the renderer instrumentation. The Electron plugin should treat that carrier as optional instead of passing undefined to the propagation layer.

Additional Notes

This is the caller-side companion to #9980 and remains independently safe if the propagation-layer guard changes separately.

Validation:

  • PLUGINS=electron npm run test:plugins (72 passing)
  • PLUGINS=electron npm run test:plugins:ci (72 passing; changed production lines covered)
  • npm run lint

@dd-octo-sts

dd-octo-sts Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 8.42 MB
Deduped: 9.09 MB
No deduping: 9.09 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.3 | 125.43 kB | 445.14 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

@pr-commenter

pr-commenter Bot commented Aug 28, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-28 09:42:08

Comparing candidate commit c80f7ae in PR branch bfernandes/fix-electron-ipc-missing-carrier with baseline commit d140900 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2296 metrics, 14 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-iast-no-vulnerability-iast-enabled-default-config-24

  • unstable max_rss_usage [-22.237MB; +42.760MB] or [-6.641%; +12.770%]

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

  • unstable max_rss_usage [-23391.271KB; +22692.071KB] or [-6.136%; +5.953%]

scenario:debugger-line-probe-with-snapshot-default-26

  • unstable max_rss_usage [-5.802MB; +17.800MB] or [-2.464%; +7.559%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-253.034ms; +412.792ms] or [-5.374%; +8.767%]
  • unstable execution_time [-257.757ms; +416.245ms] or [-5.388%; +8.701%]
  • unstable throughput [-148230.009op/s; +92180.735op/s] or [-8.450%; +5.255%]

scenario:plugin-aws-sdk-extract-response-body-24

  • unstable cpu_user_time [-58.351ms; +117.028ms] or [-3.630%; +7.279%]
  • unstable execution_time [-58.899ms; +111.302ms] or [-3.639%; +6.877%]
  • unstable throughput [-323492.686op/s; +176908.461op/s] or [-6.491%; +3.550%]

scenario:plugin-claude-agent-sdk-compact-stream-scan-26

  • unstable cpu_usage_percentage [-7.337%; +2.862%]

scenario:plugin-graphql-long-with-depth-and-collapse-off-20

  • unstable max_rss_usage [-21.623MB; +54.772MB] or [-5.454%; +13.815%]

scenario:plugin-memcached-hashring-24

  • unstable execution_time [-130.886ms; +246.926ms] or [-5.085%; +9.593%]
  • unstable throughput [-1158235.470op/s; +607531.325op/s] or [-7.776%; +4.079%]

scenario:test-optimization-large-suite-20

  • unstable max_rss_usage [-5211.365KB; +3460.365KB] or [-6.520%; +4.330%]

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 28, 2026

Copy link
Copy Markdown

Tests

All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 98.59% (-0.00%)

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

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.08%. Comparing base (d140900) to head (c80f7ae).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10041      +/-   ##
==========================================
- Coverage   98.58%   98.08%   -0.51%     
==========================================
  Files         991      987       -4     
  Lines      149346   149057     -289     
  Branches    12707    12602     -105     
==========================================
- Hits       147237   146197    -1040     
- Misses       2109     2860     +751     
Flag Coverage Δ
aiguard 62.53% <ø> (-0.03%) ⬇️
aiguard-integration 59.13% <ø> (ø)
apm-bucket-0 61.97% <ø> (-0.03%) ⬇️
apm-bucket-1 67.54% <100.00%> (-0.03%) ⬇️
apm-bucket-2 67.12% <ø> (-0.03%) ⬇️
apm-bucket-3 63.78% <ø> (-0.03%) ⬇️
apm-capabilities-tracing 62.43% <0.00%> (-0.01%) ⬇️
apm-integrations-aerospike 59.78% <ø> (-0.03%) ⬇️
apm-integrations-confluentinc-kafka-javascript 66.10% <ø> (-0.03%) ⬇️
apm-integrations-couchbase 60.32% <ø> (-0.03%) ⬇️
apm-integrations-http 65.78% <ø> (-0.03%) ⬇️
apm-integrations-kafkajs 66.70% <ø> (-0.03%) ⬇️
apm-integrations-next 63.29% <ø> (-0.03%) ⬇️
apm-integrations-prisma 61.39% <ø> (-0.03%) ⬇️
appsec 76.59% <ø> (-0.02%) ⬇️
appsec-express_fastify_graphql 73.03% <ø> (-0.02%) ⬇️
appsec-integration 49.23% <ø> (+<0.01%) ⬆️
appsec-kafka_ldapjs_lodash 67.05% <ø> (-0.03%) ⬇️
appsec-mongodb-core_mongoose_mysql 70.37% <ø> (-0.02%) ⬇️
appsec-next 56.62% <ø> (-0.02%) ⬇️
appsec-node-serialize_passport_postgres 69.82% <ø> (-0.02%) ⬇️
appsec-sourcing_stripe_template 68.20% <ø> (-0.02%) ⬇️
debugger 68.89% <ø> (-0.07%) ⬇️
instrumentations-bucket-0 55.10% <ø> (-0.03%) ⬇️
instrumentations-bucket-1 63.63% <ø> (-0.03%) ⬇️
instrumentations-bucket-10 64.87% <ø> (-0.03%) ⬇️
instrumentations-bucket-11 65.53% <ø> (-0.03%) ⬇️
instrumentations-bucket-12 54.98% <ø> (-0.03%) ⬇️
instrumentations-bucket-13 55.27% <ø> (-0.03%) ⬇️
instrumentations-bucket-14 55.10% <ø> (-0.03%) ⬇️
instrumentations-bucket-2 56.19% <ø> (-0.03%) ⬇️
instrumentations-bucket-3 57.02% <ø> (-0.03%) ⬇️
instrumentations-bucket-4 63.08% <ø> (-0.03%) ⬇️
instrumentations-bucket-5 49.31% <ø> (-0.03%) ⬇️
instrumentations-bucket-6 64.97% <ø> (-0.03%) ⬇️
instrumentations-bucket-7 55.24% <ø> (-0.03%) ⬇️
instrumentations-bucket-8 62.45% <ø> (-0.03%) ⬇️
instrumentations-bucket-9 57.84% <ø> (-0.03%) ⬇️
instrumentations-instrumentation-couchbase 53.64% <ø> (-0.03%) ⬇️
instrumentations-integration-esbuild 34.38% <ø> (ø)
llmobs-ai_anthropic_bedrock 66.35% <ø> (-0.02%) ⬇️
llmobs-bucket-1 64.46% <ø> (-0.03%) ⬇️
llmobs-openai 66.33% <ø> (-0.03%) ⬇️
llmobs-openai-agents_vertex-ai 63.50% <ø> (-0.03%) ⬇️
llmobs-sdk 75.77% <ø> (-0.03%) ⬇️
master-coverage 98.08% <100.00%> (?)
openfeature ?
openfeature-unit 57.48% <ø> (-0.03%) ⬇️
platform-core_esbuild_instrumentations-misc ?
platform-integration 64.48% <ø> (ø)
platform-shimmer_unit-guardrails_webpack ?
plugins-browser-bunyan_bullmq_cassandra 65.76% <ø> (-0.03%) ⬇️
plugins-bucket-0 60.38% <ø> (-0.03%) ⬇️
plugins-bucket-1 57.66% <ø> (ø)
plugins-bucket-11 66.26% <ø> (-0.03%) ⬇️
plugins-bucket-18 ?
plugins-bucket-19 64.39% <ø> (-0.02%) ⬇️
plugins-bucket-20 66.25% <ø> (-0.03%) ⬇️
plugins-bucket-4 60.57% <ø> (-0.03%) ⬇️
plugins-cookie_cookie-parser_crypto 54.65% <ø> (-0.03%) ⬇️
plugins-fastify_fetch_fs 64.91% <ø> (-0.03%) ⬇️
plugins-generic-pool_google-cloud-pubsub_grpc 68.54% <ø> (-0.03%) ⬇️
plugins-handlebars_hapi_hono 62.97% <ø> (-0.03%) ⬇️
plugins-ioredis_knex_langgraph 61.04% <ø> (-0.03%) ⬇️
plugins-ldapjs_light-my-request_limitd-client 62.71% <ø> (-0.02%) ⬇️
plugins-lodash_mariadb_memcached 63.32% <ø> (-0.03%) ⬇️
plugins-moleculer_mongodb_mongodb-core 65.63% <ø> (-0.03%) ⬇️
plugins-mongoose_multer_mysql 63.42% <ø> (-0.03%) ⬇️
plugins-mysql2_nats_node-serialize 65.61% <ø> (-0.03%) ⬇️
plugins-opensearch_passport-http_pino 63.44% <ø> (-0.03%) ⬇️
plugins-postgres_process_pug 62.53% <ø> (-0.03%) ⬇️
plugins-redis_router_sequelize 66.21% <ø> (-0.03%) ⬇️
plugins-test-and-upstream-rhea_undici_url 65.57% <ø> (-0.03%) ⬇️
plugins-valkey_vm_winston 61.84% <ø> (-0.03%) ⬇️
plugins-ws 63.84% <ø> (-0.03%) ⬇️
profiling 65.87% <ø> (-0.03%) ⬇️
serverless-aws-sdk-aws-sdk 54.81% <ø> (-0.02%) ⬇️
serverless-aws-sdk-base-inject-field 54.23% <ø> (-0.03%) ⬇️
serverless-aws-sdk-bedrockruntime 57.53% <ø> (-0.03%) ⬇️
serverless-aws-sdk-client 59.37% <ø> (-0.03%) ⬇️
serverless-aws-sdk-dynamodb 58.48% <ø> (-0.03%) ⬇️
serverless-aws-sdk-eventbridge 57.06% <ø> (-0.02%) ⬇️
serverless-aws-sdk-kinesis 62.58% <ø> (-0.03%) ⬇️
serverless-aws-sdk-lambda 60.48% <ø> (-0.03%) ⬇️
serverless-aws-sdk-s3 58.55% <ø> (-0.03%) ⬇️
serverless-aws-sdk-serverless-peer-service 63.15% <ø> (-0.03%) ⬇️
serverless-aws-sdk-sns 63.49% <ø> (-0.03%) ⬇️
serverless-aws-sdk-sqs 63.95% <ø> (-0.03%) ⬇️
serverless-aws-sdk-stepfunctions 58.35% <ø> (-0.03%) ⬇️
serverless-aws-sdk-util 54.90% <ø> (-0.03%) ⬇️
serverless-bucket-0 57.10% <ø> (ø)
serverless-bucket-1 63.11% <ø> (-0.03%) ⬇️
test-optimization-cucumber 70.45% <ø> (+0.02%) ⬆️
test-optimization-cypress 64.62% <ø> (+0.05%) ⬆️
test-optimization-jest 72.02% <ø> (+<0.01%) ⬆️
test-optimization-mocha 71.88% <ø> (+0.05%) ⬆️
test-optimization-playwright-playwright-atr 59.50% <ø> (+<0.01%) ⬆️
test-optimization-playwright-playwright-efd 60.18% <ø> (-0.02%) ⬇️
test-optimization-playwright-playwright-final-status 59.79% <ø> (+<0.01%) ⬆️
test-optimization-playwright-playwright-impacted-tests 59.90% <ø> (+0.15%) ⬆️
test-optimization-playwright-playwright-reporting 60.92% <ø> (-0.04%) ⬇️
test-optimization-playwright-playwright-test-management 61.06% <ø> (+0.05%) ⬆️
test-optimization-playwright-playwright-test-span 59.54% <ø> (-0.05%) ⬇️
test-optimization-selenium 58.59% <ø> (-0.13%) ⬇️
test-optimization-testopt 61.64% <ø> (+0.07%) ⬆️
test-optimization-vitest 72.54% <ø> (+0.05%) ⬆️
test-optimization-vitest-browser 58.46% <ø> (+<0.01%) ⬆️
test-optimization-webdriverio 65.08% <ø> (+0.43%) ⬆️

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.

@LotharSee
LotharSee marked this pull request as ready for review August 28, 2026 12:49
@LotharSee
LotharSee requested review from a team as code owners August 28, 2026 12:49
@LotharSee
LotharSee requested a review from wconti27 August 28, 2026 12:49

@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: c80f7aece3

ℹ️ 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".

if (channel?.startsWith('datadog:')) return

const childOf = this._tracer.extract('text_map', args.at(-1))
let childOf

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 Preserve a null parent when no carrier is present

When a carrier-less IPC callback runs while a legacy tracing store is active, childOf now remains undefined; TracingPlugin.startSpan() interprets that as “inherit store.span.” Previously, extract(undefined) returned null, which explicitly forced the receive span to be a root. Consequently, an uninstrumented renderer message can be attached to an unrelated active trace despite the intended root-span behavior; initialize childOf to null and only replace it after successful extraction.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems true. @LotharSee mind having a look? It would suffice to just define childOf = null as such

@BridgeAR BridgeAR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Updated] The comment above still seems legit. Otherwise LGTM

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.

2 participants