Skip to content

feat(server-utils): Emit low cardinality mongodb span names - #23603

Merged
Lms24 merged 1 commit into
developfrom
lms/feat-server-utils-low-card-db-span-names4
Aug 28, 2026
Merged

feat(server-utils): Emit low cardinality mongodb span names#23603
Lms24 merged 1 commit into
developfrom
lms/feat-server-utils-low-card-db-span-names4

Conversation

@Lms24

@Lms24 Lms24 commented Aug 25, 2026

Copy link
Copy Markdown
Member

Mongodb has no SQL statement to summarize. With span streaming enabled:

  • mongodb spans become {db.operation.name} {db.collection.name}, e.g. find users
  • falls back to the target alone when the driver reports no operation (endSessions becomes $cmd), then to db.system.name
  • keeps the scrubbed query document out of the name; still on db.query.text
  • traceLifecycle: 'static' keeps the existing names

Added streaming node-integration tests for all mongodb test suites

Redis split out into #23741.

Refs #23523

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 866f29c. Configure here.

Comment thread packages/server-utils/test/integrations/redis/ioredis-channel-subscriber.test.ts Outdated
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.56 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.64 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.65 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.56 kB - -
@sentry/browser (incl. Tracing, Replay) 88.09 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.52 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.79 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.74 kB - -
@sentry/browser (incl. Feedback) 46.05 kB - -
@sentry/browser (incl. sendFeedback) 33.62 kB - -
@sentry/browser (incl. FeedbackAsync) 38.73 kB - -
@sentry/browser (incl. Metrics) 29.51 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.43 kB - -
@sentry/react 30.3 kB - -
@sentry/react (incl. Tracing) 50.84 kB - -
@sentry/vue 35.69 kB - -
@sentry/vue (incl. Tracing) 50.87 kB - -
@sentry/svelte 28.59 kB - -
CDN Bundle 30.35 kB - -
CDN Bundle (incl. Tracing) 49.25 kB - -
CDN Bundle (incl. Logs, Metrics) 32.58 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.15 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.17 kB - -
CDN Bundle (incl. Tracing, Replay) 86.74 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.62 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.63 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.52 kB - -
CDN Bundle - uncompressed 89.95 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.85 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.24 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.54 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.41 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.34 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.02 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 280.05 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.71 kB - -
@sentry/nextjs (client) 53.42 kB - -
@sentry/sveltekit (client) 49.08 kB - -
@sentry/core/server 65.44 kB - -
@sentry/core/browser 51.84 kB - -
@sentry/node 123.16 kB +0.05% +58 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.23 kB - -
@sentry/node - without tracing 87.75 kB +0.04% +27 B 🔺
@sentry/node - without channel injection 102.82 kB +0.06% +54 B 🔺
@sentry/aws-serverless 95.91 kB +0.03% +23 B 🔺
@sentry/cloudflare (withSentry) - minified 200.51 kB - -
@sentry/cloudflare (withSentry) 498.77 kB - -

View base workflow run

Mongodb reports no SQL statement, so there is no query summary to name its spans
after. With span streaming they use the next conventions template that can be
filled instead: the operation paired with `{db.collection.name}` (or
`{db.namespace}`), falling back to that target alone when the driver reports no
operation, and then to `{db.system.name}`.

This keeps the scrubbed query document out of the span name. It stays on
`db.query.text`.

`traceLifecycle: 'static'` keeps the existing names.

Refs #23523
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Lms24
Lms24 force-pushed the lms/feat-server-utils-low-card-db-span-names4 branch from 866f29c to 0ea02c1 比较 August 28, 2026 14:38
@Lms24 Lms24 changed the title feat(server-utils)!: Emit low cardinality redis and mongodb span names feat(server-utils)!: Emit low cardinality mongodb span names Aug 28, 2026
@Lms24 Lms24 changed the title feat(server-utils)!: Emit low cardinality mongodb span names feat(server-utils): Emit low cardinality mongodb span names Aug 28, 2026
@Lms24 Lms24 self-assigned this Aug 28, 2026
@Lms24
Lms24 marked this pull request as ready for review August 28, 2026 14:42
@Lms24
Lms24 requested review from a team as code owners August 28, 2026 14:42
@Lms24
Lms24 requested review from andreiborza and isaacs and removed request for a team August 28, 2026 14:42
@Lms24
Lms24 merged commit 419bb30 into develop Aug 28, 2026
404 of 405 checks passed
@Lms24
Lms24 deleted the lms/feat-server-utils-low-card-db-span-names4 branch August 28, 2026 15:50
注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

2 participants