Skip to content

test(log-capture): add comprehensive pino log-capture test suites [2/2]#8987

Draft
litianningdatadog wants to merge 1 commit into
tianning.li/log-capture-3a-pino-implfrom
tianning.li/log-capture-3b-pino-tests
Draft

test(log-capture): add comprehensive pino log-capture test suites [2/2]#8987
litianningdatadog wants to merge 1 commit into
tianning.li/log-capture-3a-pino-implfrom
tianning.li/log-capture-3b-pino-tests

Conversation

@litianningdatadog

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds two dedicated test suites that together exercise the full log-capture path through the pino plugin introduced in #8986.

Motivation

The pino plugin's log-capture hook operates at the serialization boundary — it intercepts the already-serialised JSON string before it reaches the output stream. The basic smoke tests in #8986 confirm the channel fires, but deeper behavioral questions need their own focused suites:

pino/test/log_capture.spec.js (unit-level, 137 lines): Does the channel emit the right payload for every log level? Does capture-only mode (logInjection: false) leave the record unmodified? Is the channel silent when logCaptureEnabled is false? These tests run without a real pino install — they drive the plugin's channel subscription directly.

datadog-instrumentations/test/pino.spec.js (instrumentation-layer, 139 lines): Does the channel fire through the full shimmer/instrumentation stack across supported pino versions (via withVersions)? Does it carry all expected fields — pid, hostname, level, time, msg? Is it silent when the instrumentation is not loaded? These tests catch regressions that unit tests cannot, because the shimmer transforms the pino write path before the plugin's hook runs.

Additional Notes

This is PR 2 of 2 splitting the original #8966:

  1. feat(log-capture): pino integration and public API [1/2] #8986 — Pino plugin implementation, TypeScript types, docs, CI, and basic tests
  2. [this PR] Comprehensive log-capture and instrumentation-layer test suites

Stacks on #8986. No production code changes — this PR is purely tests.

Test plan

  • PLUGINS=pino ./node_modules/.bin/mocha packages/datadog-plugin-pino/test/log_capture.spec.js
  • PLUGINS=pino ./node_modules/.bin/mocha packages/datadog-instrumentations/test/pino.spec.js

🤖 Generated with Claude Code

@litianningdatadog
litianningdatadog requested a review from a team as a code owner June 18, 2026 21:03
@litianningdatadog
litianningdatadog requested review from tlhunter and removed request for a team June 18, 2026 21:03
@datadog-official

datadog-official Bot commented Jun 18, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 4 Pipeline jobs failed

All Green | all-green   View in Datadog   GitHub Actions

🧪 3 Tests failed

Plugin prisma with @prisma/client >=6.1.0 <7.0.0 (6.19.3) "before all" hook in "with @prisma/client >=6.1.0 <7.0.0 (6.19.3)" from with @prisma/client >=6.1.0 <7.0.0 (6.19.3)   View in Datadog
Command failed: ./node_modules/.bin/prisma generate && ./node_modules/.bin/tsc ../generated/**/*.ts --outDir ../dist --target esnext --module commonjs --allowJs true --moduleResolution node

Error: Command failed: ./node_modules/.bin/prisma generate && ./node_modules/.bin/tsc ../generated/**/*.ts --outDir ../dist --target esnext --module commonjs --allowJs true --moduleResolution node
    at genericNodeError (node:internal/errors:998:15)
    at wrappedFn (node:internal/errors:543:14)
    at checkExecSyncError (node:child_process:926:11)
    at execSync (node:child_process:998:15)
    at execPrismaGenerate (packages/datadog-plugin-prisma/test/index.spec.js:30:5)
    at Context.<anonymous> (packages/datadog-plugin-prisma/test/index.spec.js:353:11)
Plugin prisma with @prisma/client >=7.0.0 (7.0.0) "before all" hook in "with @prisma/client >=7.0.0 (7.0.0)" from with @prisma/client >=7.0.0 (7.0.0)   View in Datadog
Command failed: ./node_modules/.bin/prisma generate && ./node_modules/.bin/tsc ../generated/**/*.ts --outDir ../v7/dist --target esnext --module commonjs --allowJs true --moduleResolution node

Error: Command failed: ./node_modules/.bin/prisma generate && ./node_modules/.bin/tsc ../generated/**/*.ts --outDir ../v7/dist --target esnext --module commonjs --allowJs true --moduleResolution node
    at genericNodeError (node:internal/errors:998:15)
    at wrappedFn (node:internal/errors:543:14)
    at checkExecSyncError (node:child_process:926:11)
    at execSync (node:child_process:998:15)
    at execPrismaGenerate (packages/datadog-plugin-prisma/test/index.spec.js:30:5)
    at Context.<anonymous> (packages/datadog-plugin-prisma/test/index.spec.js:353:11)
View all 3 test failures

APM Integrations | prisma (18, >=6.1.0 <7.0.0, gte.6.16.0.and.lt.7.0.0)   View in Datadog   GitHub Actions

APM Integrations | prisma (latest, all)   View in Datadog   GitHub Actions

View all 4 failed jobs.

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

Useful? React with 👍 / 👎

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

@dd-octo-sts

dd-octo-sts Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.27 MB
Deduped: 7.33 MB
No deduping: 7.33 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.1.0 | 101.28 kB | 840.46 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

@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: 1ad467e738

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

assert.ok(record.pid, 'should have pid')
assert.ok(record.hostname, 'should have hostname')
assert.ok(record.time, 'should have time')
assert.ok(record.level !== undefined, 'should have level')

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 Use notStrictEqual for the level check

This assertion trips the repo's no-restricted-syntax ESLint rule against assert.ok(a !== b); running ESLint on the added test file fails here, so the lint job will block the PR even though the test logic is fine. Use assert.notStrictEqual(record.level, undefined, ...) or another strict assertion for this check.

Useful? React with 👍 / 👎.

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.73%. Comparing base (3c1650c) to head (4e872dd).

Additional details and impacted files
@@                            Coverage Diff                            @@
##           tianning.li/log-capture-3a-pino-impl    #8987       +/-   ##
=========================================================================
- Coverage                                 92.43%   58.73%   -33.70%     
=========================================================================
  Files                                       879      636      -243     
  Lines                                     50400    37056    -13344     
  Branches                                   9904     4272     -5632     
=========================================================================
- Hits                                      46585    21765    -24820     
- Misses                                     3815    15291    +11476     
Flag Coverage Δ
aiguard-integration-active ?
aiguard-integration-latest ?
aiguard-integration-maintenance ?
aiguard-macos 34.61% <ø> (ø)
aiguard-ubuntu 34.76% <ø> (ø)
aiguard-windows ?
apm-capabilities-tracing-macos ?
apm-capabilities-tracing-ubuntu-active ?
apm-capabilities-tracing-ubuntu-latest ?
apm-capabilities-tracing-ubuntu-maintenance ?
apm-capabilities-tracing-ubuntu-oldest ?
apm-capabilities-tracing-windows ?
apm-integrations-aerospike-18-gte.5.2.0 33.04% <ø> (ø)
apm-integrations-aerospike-20-gte.5.5.0 33.06% <ø> (ø)
apm-integrations-aerospike-22-gte.5.12.1 33.06% <ø> (ø)
apm-integrations-aerospike-22-gte.6.0.0 33.06% <ø> (ø)
apm-integrations-aerospike-eol- 32.97% <ø> (ø)
apm-integrations-child-process ?
apm-integrations-confluentinc-kafka-javascript-18 ?
apm-integrations-confluentinc-kafka-javascript-20 ?
apm-integrations-confluentinc-kafka-javascript-22 ?
apm-integrations-confluentinc-kafka-javascript-24 39.95% <ø> (ø)
apm-integrations-couchbase-18 33.22% <ø> (ø)
apm-integrations-couchbase-eol ?
apm-integrations-dns ?
apm-integrations-elasticsearch 34.00% <ø> (ø)
apm-integrations-http-latest ?
apm-integrations-http-maintenance ?
apm-integrations-http-oldest 41.19% <ø> (ø)
apm-integrations-http2 ?
apm-integrations-kafkajs-latest ?
apm-integrations-kafkajs-oldest ?
apm-integrations-next-11.1.4 36.48% <ø> (ø)
apm-integrations-next-12.3.7 36.48% <ø> (ø)
apm-integrations-next-13.0.0 ?
apm-integrations-next-13.2.0 ?
apm-integrations-next-13.5.11 ?
apm-integrations-next-14.0.0 ?
apm-integrations-next-14.2.35 ?
apm-integrations-next-14.2.6 ?
apm-integrations-next-14.2.7 ?
apm-integrations-next-15.0.0 ?
apm-integrations-next-15.4.0 ?
apm-integrations-next-latest ?
apm-integrations-oracledb ?
apm-integrations-restify 34.99% <ø> (ø)
apm-integrations-sharedb 32.39% <ø> (ø)
apm-integrations-tedious 33.30% <ø> (ø)
appsec-express ?
appsec-fastify ?
appsec-graphql ?
appsec-integration-active ?
appsec-integration-latest ?
appsec-integration-maintenance ?
appsec-integration-oldest ?
appsec-kafka 40.24% <ø> (ø)
appsec-ldapjs 39.78% <ø> (ø)
appsec-lodash 39.70% <ø> (ø)
appsec-macos ?
appsec-mongodb-core 43.89% <ø> (ø)
appsec-mongoose ?
appsec-mysql ?
appsec-next-latest-11.1.4 ?
appsec-next-latest-12.3.7 27.64% <ø> (ø)
appsec-next-latest-13.0.0 29.11% <ø> (ø)
appsec-next-latest-13.2.0 ?
appsec-next-latest-14.0.0 ?
appsec-next-latest-14.2.35 ?
appsec-next-latest-14.2.6 ?
appsec-next-latest-15.0.0 ?
appsec-next-latest-latest ?
appsec-next-oldest-11.1.4 27.37% <ø> (+<0.01%) ⬆️
appsec-next-oldest-12.3.7 29.17% <ø> (ø)
appsec-next-oldest-13.0.0 ?
appsec-next-oldest-13.2.0 ?
appsec-next-oldest-13.5.11 ?
appsec-next-oldest-14.0.0 ?
appsec-next-oldest-14.2.35 ?
appsec-next-oldest-14.2.6 ?
appsec-next-oldest-14.2.7 ?
appsec-next-oldest-15.0.0 ?
appsec-next-oldest-latest 27.84% <ø> (ø)
appsec-node-serialize 39.01% <ø> (ø)
appsec-passport 42.64% <ø> (ø)
appsec-postgres ?
appsec-sourcing 38.42% <ø> (ø)
appsec-stripe 40.48% <ø> (-0.01%) ⬇️
appsec-template 39.25% <ø> (ø)
appsec-ubuntu ?
appsec-windows ?
debugger-ubuntu-active ?
debugger-ubuntu-latest ?
debugger-ubuntu-maintenance ?
debugger-ubuntu-oldest ?
instrumentations-instrumentation-ai 45.09% <ø> (ø)
instrumentations-instrumentation-aws-sdk 44.69% <ø> (ø)
instrumentations-instrumentation-bluebird 27.46% <ø> (ø)
instrumentations-instrumentation-body-parser 35.60% <ø> (ø)
instrumentations-instrumentation-child_process 33.36% <ø> (ø)
instrumentations-instrumentation-connect 47.97% <ø> (ø)
instrumentations-instrumentation-cookie-parser 29.37% <ø> (ø)
instrumentations-instrumentation-couchbase-18 45.76% <ø> (ø)
instrumentations-instrumentation-couchbase-eol ?
instrumentations-instrumentation-crypto 27.51% <ø> (ø)
instrumentations-instrumentation-express 29.57% <ø> (ø)
instrumentations-instrumentation-express-mongo-sanitize 29.48% <ø> (ø)
instrumentations-instrumentation-express-multi-version 41.41% <ø> (ø)
instrumentations-instrumentation-express-session 35.38% <ø> (ø)
instrumentations-instrumentation-fastify 47.97% <ø> (ø)
instrumentations-instrumentation-fetch 44.68% <ø> (ø)
instrumentations-instrumentation-fs 27.23% <ø> (ø)
instrumentations-instrumentation-generic-pool 26.98% <ø> (ø)
instrumentations-instrumentation-hono 28.67% <ø> (ø)
instrumentations-instrumentation-http 37.92% <ø> (ø)
instrumentations-instrumentation-http-client-options 37.53% <ø> (ø)
instrumentations-instrumentation-kafkajs 48.69% <ø> (ø)
instrumentations-instrumentation-knex 27.45% <ø> (ø)
instrumentations-instrumentation-koa 45.65% <ø> (ø)
instrumentations-instrumentation-light-my-request 35.23% <ø> (ø)
instrumentations-instrumentation-mongoose ?
instrumentations-instrumentation-multer 35.27% <ø> (ø)
instrumentations-instrumentation-mysql2 33.39% <ø> (ø)
instrumentations-instrumentation-openai-lifecycle 45.75% <ø> (ø)
instrumentations-instrumentation-otel-sdk-trace 25.17% <ø> (ø)
instrumentations-instrumentation-passport 39.18% <ø> (ø)
instrumentations-instrumentation-passport-http 38.87% <ø> (ø)
instrumentations-instrumentation-passport-local 39.33% <ø> (ø)
instrumentations-instrumentation-pg ?
instrumentations-instrumentation-pino 28.17% <ø> (?)
instrumentations-instrumentation-promise 27.41% <ø> (ø)
instrumentations-instrumentation-promise-js 27.42% <ø> (ø)
instrumentations-instrumentation-q 27.44% <ø> (ø)
instrumentations-instrumentation-restify 47.23% <ø> (ø)
instrumentations-instrumentation-router 43.32% <ø> (ø)
instrumentations-instrumentation-stripe 27.93% <ø> (ø)
instrumentations-instrumentation-url 27.35% <ø> (ø)
instrumentations-instrumentation-when 27.42% <ø> (ø)
instrumentations-instrumentation-zlib 27.39% <ø> (ø)
instrumentations-integration-esbuild-0.16.12-latest ?
instrumentations-integration-esbuild-0.16.12-maintenance ?
instrumentations-integration-esbuild-0.16.12-oldest ?
instrumentations-integration-esbuild-latest-active ?
instrumentations-integration-esbuild-latest-maintenance ?
instrumentations-integration-esbuild-latest-oldest ?
llmobs-ai ?
llmobs-anthropic ?
llmobs-bedrock ?
llmobs-google-genai ?
llmobs-langchain ?
llmobs-openai-latest ?
llmobs-openai-oldest ?
llmobs-sdk-active ?
llmobs-sdk-latest ?
llmobs-sdk-maintenance ?
llmobs-sdk-oldest ?
llmobs-vertex-ai ?
openfeature-macos 37.42% <ø> (ø)
openfeature-ubuntu ?
openfeature-unit-active 50.08% <ø> (ø)
openfeature-unit-latest 50.08% <ø> (ø)
openfeature-unit-maintenance 50.44% <ø> (ø)
openfeature-unit-oldest 50.44% <ø> (ø)
openfeature-windows ?
platform-core 45.91% <ø> (ø)
platform-esbuild 46.93% <ø> (ø)
platform-instrumentations-misc 29.41% <ø> (ø)
platform-integration-active ?
platform-integration-latest ?
platform-integration-maintenance ?
platform-integration-oldest ?
platform-shimmer 46.98% <ø> (ø)
platform-unit-guardrails 43.97% <ø> (ø)
platform-webpack 18.09% <ø> (ø)
plugins-aws-durable-execution-sdk-js ?
plugins-axios ?
plugins-azure-cosmos ?
plugins-azure-event-hubs ?
plugins-azure-service-bus ?
plugins-body-parser ?
plugins-bullmq ?
plugins-cassandra 33.51% <ø> (ø)
plugins-cookie 40.41% <ø> (ø)
plugins-cookie-parser 40.24% <ø> (ø)
plugins-crypto 42.29% <ø> (ø)
plugins-dd-trace-api 33.22% <ø> (ø)
plugins-express-mongo-sanitize 40.30% <ø> (ø)
plugins-express-session 40.16% <ø> (ø)
plugins-fastify ?
plugins-fetch 33.93% <ø> (ø)
plugins-fs 33.64% <ø> (ø)
plugins-generic-pool ?
plugins-google-cloud-pubsub ?
plugins-grpc 36.41% <ø> (ø)
plugins-handlebars 40.30% <ø> (ø)
plugins-hapi 35.48% <ø> (ø)
plugins-hono 35.82% <ø> (ø)
plugins-jest ?
plugins-knex 39.78% <ø> (ø)
plugins-langgraph 32.25% <ø> (ø)
plugins-ldapjs 38.76% <ø> (ø)
plugins-light-my-request 39.87% <ø> (ø)
plugins-limitd-client ?
plugins-lodash ?
plugins-mariadb ?
plugins-memcached ?
plugins-microgateway-core 34.59% <ø> (ø)
plugins-modelcontextprotocol-sdk 32.20% <ø> (ø)
plugins-mongodb ?
plugins-mongoose ?
plugins-multer 40.22% <ø> (ø)
plugins-mysql 34.50% <ø> (-0.01%) ⬇️
plugins-mysql2 ?
plugins-nats 36.22% <ø> (ø)
plugins-node-serialize 40.44% <ø> (ø)
plugins-opensearch 33.45% <ø> (ø)
plugins-passport-http 40.04% <ø> (ø)
plugins-pino ?
plugins-postgres ?
plugins-process 42.29% <ø> (ø)
plugins-pug 40.41% <ø> (ø)
plugins-redis 34.11% <ø> (-0.07%) ⬇️
plugins-router 37.91% <ø> (ø)
plugins-sequelize 39.69% <ø> (ø)
plugins-test-and-upstream-amqp10 ?
plugins-test-and-upstream-amqplib 39.08% <ø> (+0.02%) ⬆️
plugins-test-and-upstream-avsc 33.61% <ø> (ø)
plugins-test-and-upstream-bunyan 28.88% <ø> (ø)
plugins-test-and-upstream-connect ?
plugins-test-and-upstream-graphql ?
plugins-test-and-upstream-koa 35.71% <ø> (ø)
plugins-test-and-upstream-protobufjs 33.84% <ø> (ø)
plugins-test-and-upstream-rhea 39.03% <ø> (ø)
plugins-undici 34.43% <ø> (ø)
plugins-url 42.29% <ø> (ø)
plugins-valkey 33.68% <ø> (ø)
plugins-vm 42.29% <ø> (ø)
plugins-winston 29.51% <ø> (ø)
plugins-ws 36.96% <ø> (ø)
profiling-macos ?
profiling-ubuntu ?
profiling-windows ?
serverless-aws-sdk-latest-aws-sdk ?
serverless-aws-sdk-latest-bedrockruntime ?
serverless-aws-sdk-latest-client ?
serverless-aws-sdk-latest-dynamodb ?
serverless-aws-sdk-latest-eventbridge ?
serverless-aws-sdk-latest-kinesis ?
serverless-aws-sdk-latest-lambda ?
serverless-aws-sdk-latest-s3 ?
serverless-aws-sdk-latest-serverless-peer-service ?
serverless-aws-sdk-latest-sns ?
serverless-aws-sdk-latest-sqs ?
serverless-aws-sdk-latest-stepfunctions ?
serverless-aws-sdk-latest-util ?
serverless-aws-sdk-oldest-bedrockruntime ?
serverless-aws-sdk-oldest-client ?
serverless-aws-sdk-oldest-dynamodb ?
serverless-aws-sdk-oldest-eventbridge ?
serverless-aws-sdk-oldest-kinesis ?
serverless-aws-sdk-oldest-lambda ?
serverless-aws-sdk-oldest-s3 ?
serverless-aws-sdk-oldest-serverless-peer-service ?
serverless-aws-sdk-oldest-sns ?
serverless-aws-sdk-oldest-sqs ?
serverless-aws-sdk-oldest-stepfunctions ?
serverless-aws-sdk-oldest-util ?
serverless-azure-durable-functions ?
serverless-azure-functions-eventhubs ?
serverless-azure-functions-servicebus ?
serverless-lambda 34.27% <ø> (ø)
test-optimization-cucumber-latest-7.0.0 ?
test-optimization-cucumber-latest-latest ?
test-optimization-cucumber-oldest-7.0.0 ?
test-optimization-cypress-latest-12.0.0-commonJS ?
test-optimization-cypress-latest-12.0.0-esm ?
test-optimization-cypress-latest-14.5.4-commonJS ?
test-optimization-cypress-latest-14.5.4-esm ?
test-optimization-cypress-latest-latest-commonJS ?
test-optimization-cypress-latest-latest-esm ?
test-optimization-cypress-oldest-12.0.0-commonJS ?
test-optimization-cypress-oldest-12.0.0-esm ?
test-optimization-cypress-oldest-14.5.4-commonJS ?
test-optimization-cypress-oldest-14.5.4-esm ?
test-optimization-jest-latest-latest ?
test-optimization-jest-latest-oldest ?
test-optimization-jest-oldest-latest ?
test-optimization-jest-oldest-oldest ?
test-optimization-mocha-latest-latest ?
test-optimization-mocha-latest-oldest ?
test-optimization-mocha-oldest-latest ?
test-optimization-mocha-oldest-oldest ?
test-optimization-playwright-latest-latest-playwright-active-test-span ?
test-optimization-playwright-latest-latest-playwright-atr ?
test-optimization-playwright-latest-latest-playwright-efd ?
test-optimization-playwright-latest-latest-playwright-final-status ?
test-optimization-playwright-latest-latest-playwright-impacted-tests ?
test-optimization-playwright-latest-latest-playwright-reporting ?
test-optimization-playwright-latest-latest-playwright-test-management ?
test-optimization-playwright-latest-oldest-playwright-atr ?
test-optimization-playwright-latest-oldest-playwright-efd ?
test-optimization-playwright-latest-oldest-playwright-final-status ?
test-optimization-playwright-latest-oldest-playwright-impacted-tests ?
test-optimization-playwright-latest-oldest-playwright-reporting ?
test-optimization-playwright-latest-oldest-playwright-test-management ?
test-optimization-playwright-oldest-latest-playwright-active-test-span ?
test-optimization-playwright-oldest-latest-playwright-atr ?
test-optimization-playwright-oldest-latest-playwright-efd ?
test-optimization-playwright-oldest-latest-playwright-final-status ?
test-optimization-playwright-oldest-latest-playwright-impacted-tests ?
test-optimization-playwright-oldest-latest-playwright-reporting ?
test-optimization-playwright-oldest-latest-playwright-test-management ?
test-optimization-playwright-oldest-oldest-playwright-active-test-span ?
test-optimization-playwright-oldest-oldest-playwright-atr ?
test-optimization-playwright-oldest-oldest-playwright-efd ?
test-optimization-playwright-oldest-oldest-playwright-final-status ?
test-optimization-playwright-oldest-oldest-playwright-impacted-tests ?
test-optimization-playwright-oldest-oldest-playwright-reporting ?
test-optimization-playwright-oldest-oldest-playwright-test-management ?
test-optimization-selenium-latest ?
test-optimization-selenium-oldest ?
test-optimization-testopt-active ?
test-optimization-testopt-latest ?
test-optimization-testopt-maintenance ?
test-optimization-testopt-oldest ?
test-optimization-vitest-latest ?
test-optimization-vitest-oldest 42.39% <ø> (-5.65%) ⬇️

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.

@pr-commenter

pr-commenter Bot commented Jun 18, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-22 18:10:55

Comparing candidate commit 4e872dd in PR branch tianning.li/log-capture-3b-pino-tests with baseline commit 3c1650c in branch tianning.li/log-capture-3a-pino-impl.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1952 metrics, 13 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-24

  • unstable execution_time [-153.232ms; +150.759ms] or [-5.854%; +5.760%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-169421.187µs; +169271.887µs] or [-6.849%; +6.843%]

scenario:appsec-control-20

  • unstable execution_time [-128.558ms; +137.660ms] or [-7.511%; +8.042%]

scenario:appsec-control-24

  • unstable execution_time [-92752.172µs; +92452.838µs] or [-7.740%; +7.715%]

scenario:appsec-control-26

  • unstable execution_time [-100.080ms; +94.999ms] or [-8.512%; +8.080%]

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

  • unstable max_rss_usage [-7.997MB; +19.261MB] or [-4.244%; +10.221%]

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

  • unstable max_rss_usage [-26.725MB; +18.452MB] or [-10.141%; +7.002%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-216.953ms; +300.713ms] or [-4.252%; +5.894%]

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

  • unstable cpu_user_time [-446.655ms; +282.170ms] or [-9.771%; +6.172%]
  • unstable execution_time [-474.208ms; +292.756ms] or [-9.750%; +6.019%]
  • unstable max_rss_usage [-50.582MB; +24.080MB] or [-9.194%; +4.377%]

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

  • unstable max_rss_usage [-8.111MB; +12.975MB] or [-5.821%; +9.312%]

scenario:spans-finish-later-26

  • unstable max_rss_usage [-18.147MB; +11.340MB] or [-10.991%; +6.868%]

@litianningdatadog
litianningdatadog force-pushed the tianning.li/log-capture-3b-pino-tests branch from 1ad467e to 6daf344 Compare June 18, 2026 22:08
@litianningdatadog
litianningdatadog force-pushed the tianning.li/log-capture-3a-pino-impl branch from bce6622 to 9d44a89 Compare June 18, 2026 22:10
@litianningdatadog
litianningdatadog force-pushed the tianning.li/log-capture-3b-pino-tests branch from 6daf344 to d683d88 Compare June 18, 2026 22:11
@litianningdatadog
litianningdatadog force-pushed the tianning.li/log-capture-3a-pino-impl branch from 9d44a89 to 23e1b02 Compare June 18, 2026 22:22
@litianningdatadog
litianningdatadog requested a review from a team as a code owner June 18, 2026 22:22
@litianningdatadog
litianningdatadog force-pushed the tianning.li/log-capture-3b-pino-tests branch from d683d88 to b52a856 Compare June 18, 2026 22:23
@litianningdatadog
litianningdatadog force-pushed the tianning.li/log-capture-3a-pino-impl branch from 23e1b02 to 3d12747 Compare June 22, 2026 16:35
@litianningdatadog
litianningdatadog requested review from a team as code owners June 22, 2026 16:35
@litianningdatadog
litianningdatadog force-pushed the tianning.li/log-capture-3b-pino-tests branch from b52a856 to ef89303 Compare June 22, 2026 16:35
@litianningdatadog
litianningdatadog force-pushed the tianning.li/log-capture-3a-pino-impl branch from 3d12747 to ac2f01a Compare June 22, 2026 16:49
@litianningdatadog
litianningdatadog requested a review from a team as a code owner June 22, 2026 16:49
@litianningdatadog
litianningdatadog requested review from khanayan123 and removed request for a team June 22, 2026 16:49
@litianningdatadog
litianningdatadog force-pushed the tianning.li/log-capture-3b-pino-tests branch from ef89303 to 200488d Compare June 22, 2026 16:49
@litianningdatadog
litianningdatadog force-pushed the tianning.li/log-capture-3a-pino-impl branch from ac2f01a to 5a27ddb Compare June 22, 2026 17:32
@litianningdatadog
litianningdatadog force-pushed the tianning.li/log-capture-3b-pino-tests branch from 200488d to 662cbe6 Compare June 22, 2026 17:33
@litianningdatadog
litianningdatadog force-pushed the tianning.li/log-capture-3a-pino-impl branch from 5a27ddb to 3c1650c Compare June 22, 2026 17:57
285-line test suite split across two files:

pino/test/log_capture.spec.js (137 lines):
  Unit-level tests for the apm:pino:log:json diagnostic channel. Verifies
  that the channel fires with the correct JSON payload for each log level,
  that capture-only mode (logInjection: false) does not inject dd fields,
  and that log capture is a no-op when logCaptureEnabled is false.

datadog-instrumentations/test/pino.spec.js (139 lines):
  Instrumentation-layer integration tests using withVersions. Verifies the
  JSON channel emits the full serialized record (pid, hostname, level,
  time, msg) across supported pino releases, and that the channel is
  silent when the pino instrumentation is not loaded.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an instrumentation-layer test suite to validate the pino log-capture diagnostic channel (apm:pino:log:json) behavior end-to-end through the datadog-instrumentations shimmer hooks, across supported pino versions.

Changes:

  • Introduces pino.spec.js instrumentation tests that assert the JSON-line channel fires on logger.info() and that the serialized record contains expected core fields.
  • Adds a “no subscribers” scenario intended to validate the hasSubscribers fast-path guard in the pino instrumentation wrapper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +131 to +137
it('should not emit to json channel when there are no subscribers', () => {
// PinoPlugin is disabled (logInjection=false, logCaptureEnabled=false), so the only
// way hasSubscribers can be true is if external code subscribed — there is none here.
assert.strictEqual(jsonCh.hasSubscribers, false)

logger.info('no subscriber test')
})
Comment on lines +62 to +67
setImmediate(() => {
assert.ok(captured, 'json channel should have fired')
const record = JSON.parse(captured.line)
assert.strictEqual(record.msg, 'capture test')
done()
})
Comment on lines +73 to +82
setImmediate(() => {
assert.ok(captured, 'json channel should have fired')
const record = JSON.parse(captured.line)
assert.ok(record.pid, 'should have pid')
assert.ok(record.hostname, 'should have hostname')
assert.ok(record.time, 'should have time')
assert.ok(record.level !== undefined, 'should have level')
assert.strictEqual(record.msg, 'full record test')
done()
})
Comment on lines +88 to +94
setImmediate(() => {
assert.ok(captured, 'json channel should have fired')
const record = JSON.parse(captured.line)
assert.strictEqual(record.msg, 'with extra field')
assert.strictEqual(record.extra, 'field')
done()
})
@tlhunter

Copy link
Copy Markdown
Member

The bot concerns are valid. I'll set this to draft, feel free to undraft once the changes have been made.

@tlhunter
tlhunter marked this pull request as draft June 25, 2026 20:54
@litianningdatadog litianningdatadog added the lambda-lite Lambda Lite related work label Jun 26, 2026
@tlhunter
tlhunter removed their request for review July 15, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lambda-lite Lambda Lite related work semver-patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants