Skip to content

perf(elasticsearch): cache per-instance tag keys and skip empty param…#8376

Open
BridgeAR wants to merge 3 commits into
masterfrom
BridgeAR/2026-05-08-perf-elasticsearch-tags
Open

perf(elasticsearch): cache per-instance tag keys and skip empty param…#8376
BridgeAR wants to merge 3 commits into
masterfrom
BridgeAR/2026-05-08-perf-elasticsearch-tags

Conversation

@BridgeAR
Copy link
Copy Markdown
Member

@BridgeAR BridgeAR commented May 8, 2026

…s stringify

Two related per-call wins on elasticsearch / opensearch spans:

  1. bindStart ran JSON.stringify(params.querystring || params.query) even when both fields were absent, tagging the literal string "undefined" on every span without a query. The stringify is now gated on the presence of either field; spans without a query carry no ${system}.params tag at all.
  2. The four ${this.system}.… tag keys are cached on the instance at construction so the hot path stops allocating four template-literal strings per call. Per-instance rather than module-scope keeps the OpenSearchPlugin subclass's opensearch.* prefix intact.

@BridgeAR BridgeAR requested a review from a team as a code owner May 8, 2026 18:43
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Overall package size

Self size: 5.82 MB
Deduped: 6.66 MB
No deduping: 6.66 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.1 | 82.56 kB | 817.39 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@datadog-official
Copy link
Copy Markdown

datadog-official Bot commented May 8, 2026

Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 6 Tests failed

Plugin with @elastic/elasticsearch >=5.6.16 <8 (5.6.16) elasticsearch without configuration should skip tags for unavailable fields from without configuration   View in Datadog   (Fix with Cursor)
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

undefined !== '{}'

    at /home/runner/work/dd-trace-js/dd-trace-js/packages/datadog-plugin-elasticsearch/test/index.spec.js:174:22
    at handler (/home/runner/work/dd-trace-js/dd-trace-js/packages/dd-trace/test/plugins/agent.js:265:22)
    at /home/runner/work/dd-trace-js/dd-trace-js/packages/dd-trace/test/plugins/agent.js:143:7
    at Set.forEach (<anonymous>)
    at handleTraceRequest (/home/runner/work/dd-trace-js/dd-trace-js/packages/dd-trace/test/plugins/agent.js:139:17)
    at Layer.handleRequest (/home/runner/work/dd-trace-js/dd-trace-js/node_modules/router/lib/layer.js:152:17)
...
Plugin with @elastic/elasticsearch >=5.6.16 <8 (7.17.14) elasticsearch without configuration should skip tags for unavailable fields from without configuration   View in Datadog   (Fix with Cursor)
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

undefined !== '{}'

    at /home/runner/work/dd-trace-js/dd-trace-js/packages/datadog-plugin-elasticsearch/test/index.spec.js:174:22
    at handler (/home/runner/work/dd-trace-js/dd-trace-js/packages/dd-trace/test/plugins/agent.js:265:22)
    at /home/runner/work/dd-trace-js/dd-trace-js/packages/dd-trace/test/plugins/agent.js:143:7
    at Set.forEach (<anonymous>)
    at handleTraceRequest (/home/runner/work/dd-trace-js/dd-trace-js/packages/dd-trace/test/plugins/agent.js:139:17)
    at Layer.handleRequest (/home/runner/work/dd-trace-js/dd-trace-js/node_modules/router/lib/layer.js:152:17)
...
Plugin with @elastic/elasticsearch >=8 (8.0.0) elasticsearch without configuration should skip tags for unavailable fields from without configuration   View in Datadog   (Fix with Cursor)
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

undefined !== '{}'

    at /home/runner/work/dd-trace-js/dd-trace-js/packages/datadog-plugin-elasticsearch/test/index.spec.js:174:22
    at handler (/home/runner/work/dd-trace-js/dd-trace-js/packages/dd-trace/test/plugins/agent.js:265:22)
    at /home/runner/work/dd-trace-js/dd-trace-js/packages/dd-trace/test/plugins/agent.js:143:7
    at Set.forEach (<anonymous>)
    at handleTraceRequest (/home/runner/work/dd-trace-js/dd-trace-js/packages/dd-trace/test/plugins/agent.js:139:17)
    at Layer.handleRequest (/home/runner/work/dd-trace-js/dd-trace-js/node_modules/router/lib/layer.js:152:17)
...
View all

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 81.82%
Overall Coverage: 86.78% (+0.03%)

Useful? React with 👍 / 👎

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.97%. Comparing base (807fceb) to head (05fc035).
⚠️ Report is 33 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #8376    +/-   ##
========================================
  Coverage   89.96%   89.97%            
========================================
  Files         836      838     +2     
  Lines       44867    45016   +149     
  Branches     8320     8377    +57     
========================================
+ Hits        40366    40503   +137     
- Misses       4501     4513    +12     
Flag Coverage Δ
aiguard-integration-active 40.67% <ø> (+0.11%) ⬆️
aiguard-integration-latest 40.62% <ø> (+0.11%) ⬆️
aiguard-integration-maintenance 40.67% <ø> (+0.11%) ⬆️
aiguard-macos 35.37% <ø> (+0.05%) ⬆️
aiguard-ubuntu 35.47% <ø> (+0.05%) ⬆️
aiguard-windows 35.28% <ø> (+0.05%) ⬆️
apm-capabilities-tracing-macos 49.03% <0.00%> (-0.01%) ⬇️
apm-capabilities-tracing-ubuntu-active 49.06% <0.00%> (-0.01%) ⬇️
apm-capabilities-tracing-ubuntu-latest 49.03% <0.00%> (-0.01%) ⬇️
apm-capabilities-tracing-ubuntu-maintenance 49.23% <0.00%> (-0.01%) ⬇️
apm-capabilities-tracing-ubuntu-oldest 49.23% <0.00%> (-0.01%) ⬇️
apm-capabilities-tracing-windows 49.04% <0.00%> (-0.01%) ⬇️
apm-integrations-aerospike-18-gte.5.2.0 34.44% <ø> (+0.08%) ⬆️
apm-integrations-aerospike-20-gte.5.5.0 34.45% <ø> (+0.08%) ⬆️
apm-integrations-aerospike-22-gte.5.12.1 34.45% <ø> (+0.08%) ⬆️
apm-integrations-aerospike-22-gte.6.0.0 34.45% <ø> (+0.08%) ⬆️
apm-integrations-aerospike-eol- 34.36% <ø> (+0.08%) ⬆️
apm-integrations-child-process 35.42% <ø> (+0.08%) ⬆️
apm-integrations-confluentinc-kafka-javascript-18 41.27% <ø> (+0.09%) ⬆️
apm-integrations-confluentinc-kafka-javascript-20 41.28% <ø> (+0.09%) ⬆️
apm-integrations-confluentinc-kafka-javascript-22 41.28% <ø> (+0.09%) ⬆️
apm-integrations-confluentinc-kafka-javascript-24 41.22% <ø> (+0.09%) ⬆️
apm-integrations-couchbase-18 34.61% <ø> (-0.15%) ⬇️
apm-integrations-couchbase-eol 34.72% <ø> (-0.06%) ⬇️
apm-integrations-dns 34.30% <ø> (+0.08%) ⬆️
apm-integrations-elasticsearch ?
apm-integrations-http-latest 42.26% <ø> (+0.10%) ⬆️
apm-integrations-http-maintenance 42.31% <ø> (+0.10%) ⬆️
apm-integrations-http-oldest 42.32% <ø> (+0.10%) ⬆️
apm-integrations-http2 39.62% <ø> (+0.08%) ⬆️
apm-integrations-kafkajs-latest 41.17% <ø> (+0.10%) ⬆️
apm-integrations-kafkajs-oldest 41.22% <ø> (+0.10%) ⬆️
apm-integrations-net 35.00% <ø> (+0.08%) ⬆️
apm-integrations-next-11.1.4 29.10% <ø> (-0.01%) ⬇️
apm-integrations-next-13.2.0 30.79% <ø> (-0.02%) ⬇️
apm-integrations-next-gte.10.2.0.and.lt.11 22.99% <ø> (ø)
apm-integrations-next-gte.11.0.0.and.lt.13 30.79% <ø> (-0.02%) ⬇️
apm-integrations-next-gte.13.0.0.and.lt.14 31.04% <ø> (-0.02%) ⬇️
apm-integrations-next-gte.14.0.0.and.lte.14.2.6 30.86% <ø> (-0.04%) ⬇️
apm-integrations-next-gte.14.2.7.and.lt.15 30.86% <ø> (-0.02%) ⬇️
apm-integrations-next-gte.15.0.0 30.92% <ø> (-0.02%) ⬇️
apm-integrations-oracledb 34.73% <ø> (+0.08%) ⬆️
apm-integrations-prisma-18-gte.6.16.0.and.lt.7.0.0 36.71% <ø> (+1.67%) ⬆️
apm-integrations-prisma-latest-all 35.52% <ø> (+0.07%) ⬆️
apm-integrations-restify 36.48% <ø> (+0.08%) ⬆️
apm-integrations-sharedb 33.98% <ø> (+0.08%) ⬆️
apm-integrations-tedious 34.53% <ø> (+0.08%) ⬆️
appsec-express 52.02% <ø> (+0.05%) ⬆️
appsec-fastify 48.71% <ø> (+0.02%) ⬆️
appsec-graphql 48.94% <ø> (-0.03%) ⬇️
appsec-integration-active 36.97% <ø> (+0.05%) ⬆️
appsec-integration-latest 36.94% <ø> (+0.05%) ⬆️
appsec-integration-maintenance 36.96% <ø> (+0.05%) ⬆️
appsec-integration-oldest 36.96% <ø> (+0.05%) ⬆️
appsec-kafka 41.55% <ø> (+0.08%) ⬆️
appsec-ldapjs 40.76% <ø> (+0.04%) ⬆️
appsec-lodash 40.87% <ø> (+0.04%) ⬆️
appsec-macos 55.84% <ø> (+0.02%) ⬆️
appsec-mongodb-core 45.20% <ø> (+0.03%) ⬆️
appsec-mongoose 46.05% <ø> (+0.03%) ⬆️
appsec-mysql 48.09% <ø> (+0.09%) ⬆️
appsec-next-latest-11.1.4 29.21% <ø> (-0.01%) ⬇️
appsec-next-latest-13.2.0 30.93% <ø> (-0.02%) ⬇️
appsec-next-latest-gte.10.2.0.and.lt.11 28.86% <ø> (+0.19%) ⬆️
appsec-next-latest-gte.11.0.0.and.lt.13 30.91% <ø> (-0.02%) ⬇️
appsec-next-latest-gte.13.0.0.and.lt.14 31.16% <ø> (-0.02%) ⬇️
appsec-next-latest-gte.14.0.0.and.lte.14.2.6 31.00% <ø> (-0.02%) ⬇️
appsec-next-latest-gte.14.2.7.and.lt.15 31.00% <ø> (-0.02%) ⬇️
appsec-next-latest-gte.15.0.0 31.00% <ø> (-0.02%) ⬇️
appsec-next-oldest-11.1.4 29.23% <ø> (-0.01%) ⬇️
appsec-next-oldest-13.2.0 31.21% <ø> (-0.02%) ⬇️
appsec-next-oldest-gte.10.2.0.and.lt.11 28.98% <ø> (+0.19%) ⬆️
appsec-next-oldest-gte.11.0.0.and.lt.13 30.93% <ø> (-0.02%) ⬇️
appsec-next-oldest-gte.13.0.0.and.lt.14 31.40% <ø> (-0.02%) ⬇️
appsec-next-oldest-gte.14.0.0.and.lte.14.2.6 31.24% <ø> (-0.02%) ⬇️
appsec-next-oldest-gte.14.2.7.and.lt.15 31.24% <ø> (-0.02%) ⬇️
appsec-next-oldest-gte.15.0.0 31.24% <ø> (-0.02%) ⬇️
appsec-node-serialize 40.09% <ø> (+0.04%) ⬆️
appsec-passport 43.81% <ø> (+0.11%) ⬆️
appsec-postgres 47.66% <ø> (+0.05%) ⬆️
appsec-sourcing 39.44% <ø> (+0.06%) ⬆️
appsec-stripe 41.60% <ø> (+0.10%) ⬆️
appsec-template 40.25% <ø> (+0.04%) ⬆️
appsec-ubuntu 55.92% <ø> (+0.02%) ⬆️
appsec-windows 55.76% <ø> (+0.01%) ⬆️
debugger-ubuntu-active 43.32% <ø> (+0.14%) ⬆️
debugger-ubuntu-latest 43.27% <ø> (+0.14%) ⬆️
debugger-ubuntu-maintenance 43.33% <ø> (-0.29%) ⬇️
debugger-ubuntu-oldest 43.77% <ø> (+0.13%) ⬆️
instrumentations-instrumentation-bluebird 29.33% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-body-parser 37.02% <ø> (+0.07%) ⬆️
instrumentations-instrumentation-child_process 34.91% <ø> (+0.08%) ⬆️
instrumentations-instrumentation-cookie-parser 31.16% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-express 31.37% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-express-mongo-sanitize 31.28% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-express-session 36.71% <ø> (+0.07%) ⬆️
instrumentations-instrumentation-fs 29.01% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-generic-pool 29.98% <ø> (+0.12%) ⬆️
instrumentations-instrumentation-http 36.38% <ø> (+0.08%) ⬆️
instrumentations-instrumentation-knex 29.30% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-light-my-request 36.64% <ø> (+0.07%) ⬆️
instrumentations-instrumentation-mongoose 30.42% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-multer 36.80% <ø> (+0.07%) ⬆️
instrumentations-instrumentation-mysql2 34.94% <ø> (+0.08%) ⬆️
instrumentations-instrumentation-passport 40.48% <ø> (+0.13%) ⬆️
instrumentations-instrumentation-passport-http 40.23% <ø> (+0.11%) ⬆️
instrumentations-instrumentation-passport-local 40.72% <ø> (+0.11%) ⬆️
instrumentations-instrumentation-pg 34.52% <ø> (+0.10%) ⬆️
instrumentations-instrumentation-promise 29.26% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-promise-js 29.27% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-q 29.30% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-url 29.27% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-when 29.28% <ø> (-0.02%) ⬇️
instrumentations-integration-esbuild-active 19.39% <ø> (+0.08%) ⬆️
instrumentations-integration-esbuild-latest 19.37% <ø> (+0.08%) ⬆️
instrumentations-integration-esbuild-maintenance 19.39% <ø> (+0.08%) ⬆️
instrumentations-integration-esbuild-oldest 19.38% <ø> (+0.08%) ⬆️
llmobs-ai 37.83% <ø> (+0.06%) ⬆️
llmobs-anthropic 37.83% <ø> (+<0.01%) ⬆️
llmobs-bedrock 36.60% <ø> (+0.08%) ⬆️
llmobs-google-genai 36.91% <ø> (+0.06%) ⬆️
llmobs-langchain 36.59% <ø> (+0.04%) ⬆️
llmobs-openai 40.65% <ø> (+0.05%) ⬆️
llmobs-sdk-active 45.51% <ø> (+0.09%) ⬆️
llmobs-sdk-latest 45.44% <ø> (+0.09%) ⬆️
llmobs-sdk-maintenance 45.51% <ø> (+0.09%) ⬆️
llmobs-sdk-oldest 45.49% <ø> (+0.09%) ⬆️
llmobs-vertex-ai 37.06% <ø> (+0.06%) ⬆️
openfeature-macos 38.07% <ø> (+0.15%) ⬆️
openfeature-ubuntu 38.15% <ø> (+0.15%) ⬆️
openfeature-unit-active 48.65% <ø> (+0.14%) ⬆️
openfeature-unit-latest 48.49% <ø> (+0.14%) ⬆️
openfeature-unit-maintenance 48.65% <ø> (+0.14%) ⬆️
openfeature-unit-oldest 48.65% <ø> (+0.14%) ⬆️
openfeature-windows 37.95% <ø> (+0.20%) ⬆️
platform-core 37.27% <ø> (ø)
platform-esbuild 40.61% <ø> (ø)
platform-instrumentations-misc 30.81% <ø> (+0.12%) ⬆️
platform-integration-active 47.15% <ø> (+0.22%) ⬆️
platform-integration-latest 47.11% <ø> (+0.22%) ⬆️
platform-integration-maintenance 47.16% <ø> (+0.22%) ⬆️
platform-integration-oldest 47.34% <ø> (+0.23%) ⬆️
platform-shimmer 42.29% <ø> (ø)
platform-unit-guardrails 36.12% <ø> (ø)
platform-webpack 20.52% <ø> (+0.08%) ⬆️
plugins-azure-durable-functions 37.07% <ø> (+0.15%) ⬆️
plugins-azure-event-hubs 34.93% <ø> (+0.17%) ⬆️
plugins-azure-service-bus 35.39% <ø> (+0.16%) ⬆️
plugins-bullmq 40.17% <ø> (+0.07%) ⬆️
plugins-cassandra 34.74% <ø> (+0.08%) ⬆️
plugins-cookie 26.65% <ø> (?)
plugins-cookie-parser 26.46% <ø> (ø)
plugins-crypto 27.69% <ø> (ø)
plugins-dd-trace-api 34.84% <ø> (+0.08%) ⬆️
plugins-express-mongo-sanitize 26.59% <ø> (ø)
plugins-express-session 26.42% <ø> (ø)
plugins-fastify 38.78% <ø> (+0.07%) ⬆️
plugins-fetch 35.11% <ø> (+0.07%) ⬆️
plugins-fs 35.19% <ø> (+0.08%) ⬆️
plugins-generic-pool 25.58% <ø> (ø)
plugins-google-cloud-pubsub 42.51% <ø> (+0.03%) ⬆️
plugins-grpc 37.56% <ø> (+0.07%) ⬆️
plugins-handlebars 26.63% <ø> (ø)
plugins-hapi 36.68% <ø> (+0.08%) ⬆️
plugins-hono 36.97% <ø> (+0.07%) ⬆️
plugins-ioredis 35.31% <ø> (+0.12%) ⬆️
plugins-knex 26.31% <ø> (ø)
plugins-langgraph 34.54% <ø> (+0.08%) ⬆️
plugins-ldapjs 24.20% <ø> (ø)
plugins-light-my-request 26.06% <ø> (ø)
plugins-limitd-client 29.56% <ø> (-0.02%) ⬇️
plugins-lodash 25.65% <ø> (ø)
plugins-mariadb 36.16% <ø> (+0.02%) ⬆️
plugins-memcached 34.93% <ø> (+0.08%) ⬆️
plugins-microgateway-core 35.81% <ø> (+0.08%) ⬆️
plugins-modelcontextprotocol-sdk 33.83% <ø> (+0.08%) ⬆️
plugins-moleculer 37.64% <ø> (+0.07%) ⬆️
plugins-mongodb 36.15% <ø> (+0.11%) ⬆️
plugins-mongodb-core 35.88% <ø> (+0.09%) ⬆️
plugins-mongoose 35.61% <ø> (+0.06%) ⬆️
plugins-multer 26.42% <ø> (ø)
plugins-mysql 35.81% <ø> (-0.01%) ⬇️
plugins-mysql2 36.03% <ø> (+0.12%) ⬆️
plugins-node-serialize 26.69% <ø> (ø)
plugins-opensearch 34.67% <100.00%> (+0.12%) ⬆️
plugins-passport-http 26.47% <ø> (ø)
plugins-pino 31.27% <ø> (-0.02%) ⬇️
plugins-postgres 34.08% <ø> (+0.16%) ⬆️
plugins-process 27.69% <ø> (ø)
plugins-pug 26.65% <ø> (ø)
plugins-redis 35.36% <ø> (+0.11%) ⬆️
plugins-router 39.13% <ø> (-0.06%) ⬇️
plugins-sequelize 25.36% <ø> (ø)
plugins-test-and-upstream-amqp10 35.17% <ø> (+0.08%) ⬆️
plugins-test-and-upstream-amqplib 40.36% <ø> (+0.05%) ⬆️
plugins-test-and-upstream-apollo 36.02% <ø> (+0.07%) ⬆️
plugins-test-and-upstream-avsc 34.51% <ø> (+0.08%) ⬆️
plugins-test-and-upstream-bunyan 30.64% <ø> (-0.02%) ⬇️
plugins-test-and-upstream-connect 37.35% <ø> (+0.07%) ⬆️
plugins-test-and-upstream-graphql 36.92% <ø> (+0.05%) ⬆️
plugins-test-and-upstream-koa 36.94% <ø> (+0.07%) ⬆️
plugins-test-and-upstream-protobufjs 34.72% <ø> (+0.08%) ⬆️
plugins-test-and-upstream-rhea 40.38% <ø> (+0.05%) ⬆️
plugins-undici 35.84% <ø> (+0.07%) ⬆️
plugins-url 27.69% <ø> (ø)
plugins-valkey 34.95% <ø> (+0.09%) ⬆️
plugins-vm 27.69% <ø> (ø)
plugins-winston 31.28% <ø> (+0.11%) ⬆️
plugins-ws 38.46% <ø> (+0.21%) ⬆️
profiling-macos 42.79% <ø> (+0.02%) ⬆️
profiling-ubuntu 43.20% <ø> (+0.07%) ⬆️
profiling-windows 40.10% <ø> (+0.08%) ⬆️
serverless-aws-sdk-latest-aws-sdk 34.80% <ø> (+0.06%) ⬆️
serverless-aws-sdk-latest-bedrockruntime 33.14% <ø> (+0.07%) ⬆️
serverless-aws-sdk-latest-client 22.38% <ø> (ø)
serverless-aws-sdk-latest-dynamodb 35.76% <ø> (+0.06%) ⬆️
serverless-aws-sdk-latest-eventbridge 28.83% <ø> (-0.01%) ⬇️
serverless-aws-sdk-latest-kinesis 38.67% <ø> (+0.04%) ⬆️
serverless-aws-sdk-latest-lambda 35.95% <ø> (+0.06%) ⬆️
serverless-aws-sdk-latest-s3 33.91% <ø> (+0.06%) ⬆️
serverless-aws-sdk-latest-serverless-peer-service 40.04% <ø> (+0.02%) ⬆️
serverless-aws-sdk-latest-sns 39.77% <ø> (+0.04%) ⬆️
serverless-aws-sdk-latest-sqs 39.06% <ø> (+0.04%) ⬆️
serverless-aws-sdk-latest-stepfunctions 34.53% <ø> (+0.07%) ⬆️
serverless-aws-sdk-latest-util 48.00% <ø> (+0.28%) ⬆️
serverless-aws-sdk-oldest-aws-sdk 34.89% <ø> (+0.06%) ⬆️
serverless-aws-sdk-oldest-bedrockruntime 33.42% <ø> (+0.07%) ⬆️
serverless-aws-sdk-oldest-client 22.75% <ø> (ø)
serverless-aws-sdk-oldest-dynamodb ?
serverless-aws-sdk-oldest-eventbridge 28.87% <ø> (-0.01%) ⬇️
serverless-aws-sdk-oldest-kinesis 38.80% <ø> (+0.04%) ⬆️
serverless-aws-sdk-oldest-lambda 36.03% <ø> (+0.06%) ⬆️
serverless-aws-sdk-oldest-s3 33.98% <ø> (+0.06%) ⬆️
serverless-aws-sdk-oldest-serverless-peer-service 40.10% <ø> (+0.02%) ⬆️
serverless-aws-sdk-oldest-sns 39.98% <ø> (+0.04%) ⬆️
serverless-aws-sdk-oldest-sqs 38.95% <ø> (+0.04%) ⬆️
serverless-aws-sdk-oldest-stepfunctions 34.61% <ø> (+0.06%) ⬆️
serverless-aws-sdk-oldest-util 48.31% <ø> (+0.28%) ⬆️
serverless-azure-functions-eventhubs 38.55% <ø> (+0.15%) ⬆️
serverless-azure-functions-servicebus 38.61% <ø> (+0.15%) ⬆️
serverless-lambda 34.50% <ø> (+1.65%) ⬆️
test-optimization-cucumber-latest-7.0.0 50.38% <ø> (+0.16%) ⬆️
test-optimization-cucumber-latest-latest 53.09% <ø> (+0.16%) ⬆️
test-optimization-cucumber-oldest-7.0.0 50.42% <ø> (+0.19%) ⬆️
test-optimization-cypress-latest-12.0.0-commonJS 48.77% <ø> (+0.57%) ⬆️
test-optimization-cypress-latest-12.0.0-esm 48.80% <ø> (+0.56%) ⬆️
test-optimization-cypress-latest-14.5.4-commonJS 48.62% <ø> (+0.59%) ⬆️
test-optimization-cypress-latest-14.5.4-esm 45.37% <ø> (-2.69%) ⬇️
test-optimization-cypress-latest-latest-commonJS 45.69% <ø> (-2.83%) ⬇️
test-optimization-cypress-latest-latest-esm 49.14% <ø> (+0.58%) ⬆️
test-optimization-cypress-oldest-12.0.0-commonJS 48.81% <ø> (+0.59%) ⬆️
test-optimization-cypress-oldest-12.0.0-esm 48.84% <ø> (+0.59%) ⬆️
test-optimization-cypress-oldest-14.5.4-commonJS 48.66% <ø> (+0.59%) ⬆️
test-optimization-cypress-oldest-14.5.4-esm 48.69% <ø> (+0.59%) ⬆️
test-optimization-jest-latest-latest 54.84% <ø> (+0.11%) ⬆️
test-optimization-jest-latest-oldest 53.66% <ø> (+0.11%) ⬆️
test-optimization-jest-oldest-latest 54.85% <ø> (+0.11%) ⬆️
test-optimization-jest-oldest-oldest 53.59% <ø> (+0.11%) ⬆️
test-optimization-mocha-latest-latest 53.39% <ø> (+0.14%) ⬆️
test-optimization-mocha-latest-oldest 51.00% <ø> (+0.15%) ⬆️
test-optimization-mocha-oldest-latest 53.45% <ø> (+0.14%) ⬆️
test-optimization-mocha-oldest-oldest 50.94% <ø> (+0.15%) ⬆️
test-optimization-playwright-latest-latest-playwright-active-test-span 44.30% <ø> (+0.34%) ⬆️
test-optimization-playwright-latest-latest-playwright-atr 43.07% <ø> (+0.17%) ⬆️
test-optimization-playwright-latest-latest-playwright-efd 43.49% <ø> (+0.21%) ⬆️
test-optimization-playwright-latest-latest-playwright-final-status 43.54% <ø> (+0.20%) ⬆️
test-optimization-playwright-latest-latest-playwright-impacted-tests 43.00% <ø> (+0.06%) ⬆️
test-optimization-playwright-latest-latest-playwright-reporting 42.94% <ø> (+0.60%) ⬆️
test-optimization-playwright-latest-latest-playwright-test-management 44.73% <ø> (+0.22%) ⬆️
test-optimization-playwright-latest-oldest-playwright-active-test-span 44.37% <ø> (+0.34%) ⬆️
test-optimization-playwright-latest-oldest-playwright-atr 43.28% <ø> (+0.18%) ⬆️
test-optimization-playwright-latest-oldest-playwright-efd 43.79% <ø> (+0.45%) ⬆️
test-optimization-playwright-latest-oldest-playwright-final-status 43.59% <ø> (+0.20%) ⬆️
test-optimization-playwright-latest-oldest-playwright-impacted-tests 43.05% <ø> (+0.06%) ⬆️
test-optimization-playwright-latest-oldest-playwright-reporting 43.01% <ø> (+0.61%) ⬆️
test-optimization-playwright-latest-oldest-playwright-test-management 44.80% <ø> (+0.22%) ⬆️
test-optimization-playwright-oldest-latest-playwright-active-test-span 44.31% <ø> (+0.32%) ⬆️
test-optimization-playwright-oldest-latest-playwright-atr 43.11% <ø> (+0.17%) ⬆️
test-optimization-playwright-oldest-latest-playwright-efd 43.51% <ø> (+0.21%) ⬆️
test-optimization-playwright-oldest-latest-playwright-final-status 43.55% <ø> (+0.17%) ⬆️
test-optimization-playwright-oldest-latest-playwright-impacted-tests 43.04% <ø> (+0.06%) ⬆️
test-optimization-playwright-oldest-latest-playwright-reporting 42.95% <ø> (+0.60%) ⬆️
test-optimization-playwright-oldest-latest-playwright-test-management 44.74% <ø> (+0.22%) ⬆️
test-optimization-playwright-oldest-oldest-playwright-active-test-span 44.40% <ø> (+0.34%) ⬆️
test-optimization-playwright-oldest-oldest-playwright-atr 43.32% <ø> (+0.18%) ⬆️
test-optimization-playwright-oldest-oldest-playwright-efd 43.56% <ø> (+0.21%) ⬆️
test-optimization-playwright-oldest-oldest-playwright-final-status 43.61% <ø> (+0.18%) ⬆️
test-optimization-playwright-oldest-oldest-playwright-impacted-tests 43.09% <ø> (+0.06%) ⬆️
test-optimization-playwright-oldest-oldest-playwright-reporting 43.03% <ø> (+0.61%) ⬆️
test-optimization-playwright-oldest-oldest-playwright-test-management 44.81% <ø> (+0.22%) ⬆️
test-optimization-selenium-latest 45.67% <ø> (+0.12%) ⬆️
test-optimization-selenium-oldest 45.17% <ø> (+0.13%) ⬆️
test-optimization-testopt-active 46.99% <ø> (+0.14%) ⬆️
test-optimization-testopt-latest 46.95% <ø> (+0.14%) ⬆️
test-optimization-testopt-maintenance 46.99% <ø> (+0.14%) ⬆️
test-optimization-testopt-oldest 47.85% <ø> (+0.15%) ⬆️
test-optimization-vitest-latest 51.05% <ø> (+0.21%) ⬆️
test-optimization-vitest-oldest 48.05% <ø> (+0.70%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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
Copy link
Copy Markdown

pr-commenter Bot commented May 8, 2026

Benchmarks

Benchmark execution time: 2026-05-12 00:32:23

Comparing candidate commit 05fc035 in PR branch BridgeAR/2026-05-08-perf-elasticsearch-tags with baseline commit 807fceb in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1734 metrics, 110 unstable metrics.

rochdev
rochdev previously approved these changes May 8, 2026
Copy link
Copy Markdown
Member

@rochdev rochdev left a comment

Choose a reason for hiding this comment

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

I'm not a fan of the unnecessary private variables to just store a zero cost string. It's just unneeded complexity. Not blocking on that though but I don't see it as a pattern worth pursuing in other PRs.

@BridgeAR BridgeAR force-pushed the BridgeAR/2026-05-08-perf-elasticsearch-tags branch from 974b874 to 62f44f6 Compare May 8, 2026 20:30
@rochdev
Copy link
Copy Markdown
Member

rochdev commented May 8, 2026

Implementation changed in the last rebase, but the test was not updated. Is that an uncovered condition?

Comment thread packages/datadog-plugin-elasticsearch/src/index.js Outdated
@BridgeAR BridgeAR marked this pull request as draft May 9, 2026 00:43
…s stringify

Two related per-call wins on elasticsearch / opensearch spans:

1. `bindStart` set the `${system}.params` tag from
   `JSON.stringify(params.querystring || params.query)` on every call.
   The elasticsearch / opensearch transports build `params.querystring`
   as an empty `{}` object on `client.ping()` and other no-querystring
   call paths, so the tag was the literal `"{}"` on every such span.
   The stringified result is now gated on `length > 2`; spans without
   a real querystring carry no params tag.
2. The four `${this.system}.…` tag keys are cached on the instance at
   construction so the hot path stops allocating four template-literal
   strings per call. Per-instance rather than module-scope keeps the
   `OpenSearchPlugin` subclass's `opensearch.*` prefix intact.

Microbench (V8 13.6 / Node 24.15, n=2 000 000 × 7 trials, drop
best+worst): typical args 99 ns → 96 ns (-3 ns, -3.5%); empty
querystring={} 21 ns → 48 ns (+27 ns, +127%). Production traffic is
dominated by the typical search / index / get path.
@BridgeAR BridgeAR force-pushed the BridgeAR/2026-05-08-perf-elasticsearch-tags branch from 62f44f6 to b098ce1 Compare May 9, 2026 16:12
@BridgeAR BridgeAR marked this pull request as ready for review May 11, 2026 17:37
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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

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

Comment thread packages/datadog-plugin-elasticsearch/src/index.js Outdated
Comment thread packages/datadog-plugin-elasticsearch/src/index.js Outdated
Comment thread packages/datadog-plugin-elasticsearch/src/index.js Outdated
Comment thread packages/datadog-plugin-elasticsearch/test/meta-tags.spec.js Outdated
Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
Comment thread packages/datadog-plugin-opensearch/test/index.spec.js Outdated
Comment thread packages/datadog-plugin-elasticsearch/test/index.spec.js Outdated
Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
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