Skip to content

feat(browser-bunyan): add log injection support - #9705

Open
BridgeAR wants to merge 2 commits into
masterfrom
BridgeAR/2026-08-05-browser-bunyan
Open

feat(browser-bunyan): add log injection support#9705
BridgeAR wants to merge 2 commits into
masterfrom
BridgeAR/2026-08-05-browser-bunyan

Conversation

@BridgeAR

@BridgeAR BridgeAR commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

  • add server-side browser-bunyan log injection
  • reuse Bunyan's record wrapper and plugin behavior while keeping configuration and channels independent
  • add CJS/ESM coverage, types, documentation, CI, and compatibility metadata

Why

Server-side browser-bunyan logs cannot currently receive trace correlation without a local patch. Sharing the existing Bunyan path prevents the implementations from drifting while preserving independent enablement.

Test plan

  • PLUGINS="bunyan|browser-bunyan" npm run test:plugins
  • scoped c8 coverage for all changed runtime lines
  • plugin structure and generated-file verification
  • current and v5 type checks
  • npm run lint

Refs: #9701
Refs: #1935

## Summary

- add browser-bunyan instrumentation, plugin registration, types, documentation, and CI coverage
- share Bunyan record wrapping and injection behavior while keeping integration channels and configuration independent
- regenerate the supported integration and configuration type outputs

## Why

Isomorphic applications using browser-bunyan otherwise need custom trace-correlation injection. Sharing Bunyan behavior prevents the two implementations from drifting without coupling their enablement.

## Test plan

- PLUGINS="bunyan|browser-bunyan" npm run test:plugins
- scoped c8 coverage and coverage-diff audit
- plugin structure, generated-file, current/v5 type, and full lint checks

Co-authored-by: Nathan Brown <nathan@nkbrown.us>
@dd-octo-sts

dd-octo-sts Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 7.85 MB
Deduped: 8.51 MB
No deduping: 8.51 MB

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

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

Copy link
Copy Markdown

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

DataDog/apm-reliability/dd-trace-js | validate_supported_configurations_v2_local_file   View in Datadog   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.52% (+0.00%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 72cd4d5 | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Aug 5, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-05 20:07:05

Comparing candidate commit 72cd4d5 in PR branch BridgeAR/2026-08-05-browser-bunyan with baseline commit d678882 in branch master.

📊 Benchmarking dashboard

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

scenario:encoders-0.4-events-native-20

  • 🟩 max_rss_usage [-9.994MB; -2.958MB] or [-7.087%; -2.098%]

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

  • unstable execution_time [-209799.506µs; +211755.340µs] or [-7.795%; +7.868%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-243022.855µs; +242135.655µs] or [-9.420%; +9.386%]

scenario:appsec-appsec-enabled-with-attacks-24

  • unstable execution_time [-161.108ms; +153.407ms] or [-5.200%; +4.951%]

scenario:appsec-appsec-enabled-with-attacks-26

  • unstable execution_time [-184.305ms; +192.142ms] or [-6.322%; +6.591%]

scenario:appsec-control-20

  • unstable execution_time [-92.337ms; +73.141ms] or [-5.649%; +4.475%]

scenario:appsec-control-24

  • unstable execution_time [-117.877ms; +90.881ms] or [-9.543%; +7.358%]

scenario:appsec-control-26

  • unstable execution_time [-118.051ms; +128.763ms] or [-9.519%; +10.383%]

scenario:appsec-iast-no-vulnerability-iast-enabled-always-active-20

  • unstable execution_time [-13.142ms; +15.168ms] or [-5.130%; +5.921%]

scenario:appsec-iast-with-vulnerability-control-20

  • unstable execution_time [-27.248ms; +32.950ms] or [-4.971%; +6.012%]

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

  • unstable cpu_user_time [-821.789ms; +1718.147ms] or [-10.285%; +21.503%]
  • unstable execution_time [-802.263ms; +1674.012ms] or [-9.207%; +19.212%]
  • unstable instructions [-7.0G instructions; +14.4G instructions] or [-10.838%; +22.217%]
  • unstable throughput [-589.447op/s; +261.289op/s] or [-15.839%; +7.021%]

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

  • unstable cpu_user_time [-531.696ms; +1016.164ms] or [-6.785%; +12.967%]
  • unstable execution_time [-504.692ms; +1016.936ms] or [-5.913%; +11.914%]
  • unstable instructions [-4.8G instructions; +8.9G instructions] or [-7.587%; +13.924%]
  • unstable throughput [-414.380op/s; +205.869op/s] or [-10.955%; +5.443%]

scenario:debugger-line-probe-without-snapshot-24

  • unstable cpu_user_time [-2.761s; +0.365s] or [-31.096%; +4.110%]
  • unstable execution_time [-2.759s; +0.373s] or [-28.725%; +3.885%]
  • unstable instructions [-23.4G instructions; +3.2G instructions] or [-32.240%; +4.349%]
  • unstable throughput [-101.427op/s; +731.544op/s] or [-2.898%; +20.902%]

scenario:debugger-line-probe-without-snapshot-26

  • unstable cpu_user_time [-4.646s; +0.020s] or [-41.840%; +0.183%]
  • unstable execution_time [-4.679s; +0.058s] or [-39.503%; +0.488%]
  • unstable instructions [-41.6G instructions; -0.0G instructions] or [-44.521%; -0.003%]
  • unstable max_rss_usage [-15.807MB; +0.603MB] or [-9.695%; +0.370%]
  • unstable throughput [-24.523op/s; +909.364op/s] or [-0.839%; +31.095%]

scenario:dogstatsd-aggregated-20

  • unstable cpu_usage_percentage [-7.010%; +4.670%]
  • unstable execution_time [-85.959ms; +136.067ms] or [-6.638%; +10.508%]
  • unstable throughput [-871104.710op/s; +552879.901op/s] or [-7.433%; +4.718%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-393.219ms; +237.134ms] or [-8.317%; +5.016%]
  • unstable execution_time [-392.767ms; +235.364ms] or [-8.180%; +4.902%]
  • unstable throughput [-84176.333op/s; +138842.117op/s] or [-4.818%; +7.947%]

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

  • unstable max_rss_usage [-35.582MB; +43.361MB] or [-8.830%; +10.761%]

scenario:plugin-graphql-long-with-depth-off-26

  • unstable max_rss_usage [-29994.918KB; +28724.633KB] or [-14.387%; +13.778%]

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

  • unstable cpu_user_time [-585.260ms; +606.489ms] or [-5.069%; +5.253%]
  • unstable execution_time [-596.486ms; +621.853ms] or [-5.065%; +5.280%]
  • unstable throughput [-3.643op/s; +3.468op/s] or [-5.330%; +5.076%]

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

  • unstable max_rss_usage [-14.017MB; +10.234MB] or [-6.185%; +4.515%]

scenario:plugin-pg-service-20

  • unstable cpu_usage_percentage [-6.234%; +4.065%]
  • unstable execution_time [-87.813ms; +139.680ms] or [-5.282%; +8.403%]
  • unstable throughput [-239359.970op/s; +150916.136op/s] or [-6.578%; +4.148%]

scenario:plugin-pg-service-26

  • unstable cpu_usage_percentage [-6.886%; +4.620%]
  • unstable execution_time [-70.253ms; +93.798ms] or [-7.903%; +10.552%]
  • unstable throughput [-520562.618op/s; +418131.712op/s] or [-7.600%; +6.104%]

scenario:test-optimization-large-suite-20

  • unstable max_rss_usage [-4199.483KB; +6176.817KB] or [-5.227%; +7.688%]

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.51%. Comparing base (d678882) to head (72cd4d5).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #9705    +/-   ##
========================================
  Coverage   98.51%   98.51%            
========================================
  Files         963      966     +3     
  Lines      135796   135824    +28     
  Branches    11984    11743   -241     
========================================
+ Hits       133785   133813    +28     
  Misses       2011     2011            
Flag Coverage Δ
aiguard 56.97% <100.00%> (-0.03%) ⬇️
aiguard-integration 55.82% <100.00%> (+<0.01%) ⬆️
apm-bucket-0 57.22% <100.00%> (-0.03%) ⬇️
apm-bucket-1 63.31% <100.00%> (-0.02%) ⬇️
apm-bucket-2 62.11% <100.00%> (-0.02%) ⬇️
apm-bucket-3 59.66% <78.12%> (-0.02%) ⬇️
apm-capabilities-tracing 62.62% <93.75%> (+<0.01%) ⬆️
apm-integrations-aerospike 56.27% <100.00%> (-0.03%) ⬇️
apm-integrations-confluentinc-kafka-javascript 60.93% <100.00%> (-0.06%) ⬇️
apm-integrations-couchbase 56.69% <100.00%> (-0.03%) ⬇️
apm-integrations-http 62.10% <100.00%> (-0.02%) ⬇️
apm-integrations-kafkajs 61.54% <100.00%> (-0.03%) ⬇️
apm-integrations-next 59.26% <100.00%> (-0.02%) ⬇️
apm-integrations-prisma 58.28% <100.00%> (-0.02%) ⬇️
appsec 72.02% <100.00%> (-0.02%) ⬇️
appsec-express_fastify_graphql 69.45% <100.00%> (-0.02%) ⬇️
appsec-integration 50.23% <55.26%> (+<0.01%) ⬆️
appsec-kafka_ldapjs_lodash 63.36% <100.00%> (+0.01%) ⬆️
appsec-mongodb-core_mongoose_mysql 66.96% <100.00%> (-0.02%) ⬇️
appsec-next 56.68% <100.00%> (-0.02%) ⬇️
appsec-node-serialize_passport_postgres 66.61% <100.00%> (-0.02%) ⬇️
appsec-sourcing_stripe_template 64.98% <100.00%> (-0.03%) ⬇️
debugger 64.19% <100.00%> (-0.02%) ⬇️
instrumentations-bucket-0 51.57% <100.00%> (-0.03%) ⬇️
instrumentations-bucket-1 59.60% <100.00%> (-0.02%) ⬇️
instrumentations-bucket-10 61.50% <100.00%> (-0.02%) ⬇️
instrumentations-bucket-11 51.49% <100.00%> (-0.03%) ⬇️
instrumentations-bucket-12 52.28% <100.00%> (-0.02%) ⬇️
instrumentations-bucket-13 51.60% <100.00%> (-0.03%) ⬇️
instrumentations-bucket-2 53.39% <100.00%> (-0.02%) ⬇️
instrumentations-bucket-3 58.66% <100.00%> (-0.02%) ⬇️
instrumentations-bucket-4 52.12% <100.00%> (-0.03%) ⬇️
instrumentations-bucket-5 57.16% <100.00%> (-0.02%) ⬇️
instrumentations-bucket-6 60.24% <100.00%> (-0.03%) ⬇️
instrumentations-bucket-7 58.02% <100.00%> (-0.03%) ⬇️
instrumentations-bucket-8 58.99% <100.00%> (-0.02%) ⬇️
instrumentations-bucket-9 61.05% <100.00%> (-0.02%) ⬇️
instrumentations-instrumentation-couchbase 50.84% <100.00%> (-0.03%) ⬇️
instrumentations-integration-esbuild 33.95% <55.26%> (+0.01%) ⬆️
llmobs-ai_anthropic_bedrock 62.81% <100.00%> (-0.02%) ⬇️
llmobs-bucket-1 61.29% <100.00%> (-0.02%) ⬇️
llmobs-openai 61.77% <100.00%> (-0.02%) ⬇️
llmobs-openai-agents_vertex-ai 59.75% <100.00%> (-0.02%) ⬇️
llmobs-sdk 66.46% <100.00%> (-0.03%) ⬇️
master-coverage 98.51% <100.00%> (?)
openfeature 55.61% <100.00%> (+<0.01%) ⬆️
openfeature-unit 53.14% <100.00%> (-0.03%) ⬇️
platform-core_esbuild_instrumentations-misc 40.55% <55.26%> (-0.01%) ⬇️
platform-integration 60.48% <100.00%> (+<0.01%) ⬆️
platform-shimmer_unit-guardrails_webpack 38.81% <55.26%> (-0.01%) ⬇️
plugins-browser-bunyan_bullmq_cassandra 61.41% <100.00%> (?)
plugins-bucket-0 56.78% <100.00%> (-0.02%) ⬇️
plugins-bucket-1 53.92% <100.00%> (+<0.01%) ⬆️
plugins-bucket-11 ?
plugins-bucket-12 61.64% <100.00%> (?)
plugins-bucket-15 58.75% <100.00%> (?)
plugins-bucket-18 61.24% <100.00%> (-0.14%) ⬇️
plugins-bucket-19 58.04% <100.00%> (-1.55%) ⬇️
plugins-bucket-20 61.28% <100.00%> (-0.31%) ⬇️
plugins-bucket-21 61.58% <100.00%> (?)
plugins-bucket-4 56.30% <100.00%> (-1.90%) ⬇️
plugins-bullmq_cassandra_cookie ?
plugins-cookie-parser_crypto_dd-trace-api ?
plugins-cookie_cookie-parser_crypto 51.11% <100.00%> (?)
plugins-fastify_fetch_fs 60.50% <100.00%> (?)
plugins-fetch_fs_generic-pool ?
plugins-generic-pool_google-cloud-pubsub_grpc 64.06% <100.00%> (?)
plugins-google-cloud-pubsub_grpc_handlebars ?
plugins-handlebars_hapi_hono 58.38% <100.00%> (?)
plugins-hapi_hono_ioredis ?
plugins-ioredis_jest_knex 57.41% <100.00%> (?)
plugins-jest_knex_langgraph ?
plugins-langgraph_ldapjs_light-my-request 57.68% <100.00%> (?)
plugins-ldapjs_light-my-request_limitd-client ?
plugins-limitd-client_lodash_mariadb 57.52% <100.00%> (?)
plugins-lodash_mariadb_memcached ?
plugins-memcached_mercurius_microgateway-core 60.90% <100.00%> (?)
plugins-moleculer_mongodb_mongodb-core ?
plugins-mongodb-core_mongoose_multer 58.85% <100.00%> (?)
plugins-mongoose_multer_mysql ?
plugins-mysql2_nats_node-serialize ?
plugins-mysql_mysql2_nats 60.40% <100.00%> (?)
plugins-opensearch_passport-http_pino ?
plugins-pino_postgres_process 58.65% <100.00%> (?)
plugins-postgres_process_pug ?
plugins-pug_redis_router 61.45% <100.00%> (?)
plugins-redis_router_sequelize ?
plugins-test-and-upstream-rhea_undici_url ?
plugins-url_valkey_vm 57.12% <100.00%> (?)
plugins-valkey_vm_winston ?
plugins-winston_ws 59.44% <100.00%> (?)
plugins-ws ?
profiling 61.44% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-aws-sdk 54.86% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-base-inject-field 50.79% <100.00%> (-0.03%) ⬇️
serverless-aws-sdk-bedrockruntime 54.50% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-client 56.10% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-dynamodb 55.37% <100.00%> (-0.01%) ⬇️
serverless-aws-sdk-eventbridge 49.36% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-kinesis 58.88% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-lambda 57.03% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-s3 55.45% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-serverless-peer-service 59.28% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-sns 59.70% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-sqs 60.13% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-stepfunctions 55.29% <100.00%> (-0.02%) ⬇️
serverless-aws-sdk-util 51.33% <100.00%> (-0.03%) ⬇️
serverless-bucket-0 54.00% <100.00%> (+<0.01%) ⬆️
serverless-bucket-1 58.82% <100.00%> (-0.02%) ⬇️
test-optimization-cucumber 71.48% <100.00%> (+0.03%) ⬆️
test-optimization-cypress 65.17% <100.00%> (+0.03%) ⬆️
test-optimization-jest 72.96% <100.00%> (-0.13%) ⬇️
test-optimization-mocha 72.52% <100.00%> (+0.05%) ⬆️
test-optimization-playwright-playwright-atr 60.15% <100.00%> (+<0.01%) ⬆️
test-optimization-playwright-playwright-efd 60.29% <100.00%> (+0.02%) ⬆️
test-optimization-playwright-playwright-final-status 60.46% <100.00%> (+0.01%) ⬆️
test-optimization-playwright-playwright-impacted-tests 59.99% <100.00%> (+0.16%) ⬆️
test-optimization-playwright-playwright-reporting 61.17% <100.00%> (-0.09%) ⬇️
test-optimization-playwright-playwright-test-management 60.98% <100.00%> (-0.09%) ⬇️
test-optimization-playwright-playwright-test-span 60.21% <100.00%> (-0.05%) ⬇️
test-optimization-selenium 59.39% <100.00%> (-0.13%) ⬇️
test-optimization-testopt 57.89% <100.00%> (+0.07%) ⬆️
test-optimization-vitest 73.63% <100.00%> (+0.11%) ⬆️
test-optimization-vitest-browser 59.04% <100.00%> (+0.07%) ⬆️
test-optimization-webdriverio 64.88% <100.00%> (+0.05%) ⬆️

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.

The browser-bunyan lockfile resolves packages through a local Verdaccio registry, so the upstream install fails before the normal plugin matrix completes.
@BridgeAR
BridgeAR marked this pull request as ready for review August 5, 2026 20:03
@BridgeAR
BridgeAR requested review from a team as code owners August 5, 2026 20:03
@BridgeAR
BridgeAR requested review from crysmags and khanayan123 and removed request for a team August 5, 2026 20:03
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.

1 participant