Skip to content

feat(core): Emit low cardinality mongoose db span names - #23782

Open
Lms24 wants to merge 1 commit into
developfrom
lms/feat-core-mongoose-low-card-span-names
Open

feat(core): Emit low cardinality mongoose db span names#23782
Lms24 wants to merge 1 commit into
developfrom
lms/feat-core-mongoose-low-card-span-names

Conversation

@Lms24

@Lms24 Lms24 commented Aug 31, 2026

Copy link
Copy Markdown
Member

With span streaming enabled:

  • mongoose spans become {db.operation.name} {db.collection.name}, e.g. findOne blogposts
  • falls back to db.namespace, then to db.system.name
  • the model name (BlogPost) is no longer part of the name — the conventions template uses db.collection.name (blogposts), which is what both mongoose paths already set
  • traceLifecycle: 'static' keeps the existing mongoose.<Model>.<op> names

Also corrects db.system.name on the monkey-patch path from mongoose to mongodb. mongoose is not a database system, and the diagnostics-channel path already emitted mongodb.

Added streaming node-integration tests for all mongoose test suites.

Refs #23523

@github-actions

github-actions Bot commented Aug 31, 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.75 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.76 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.68 kB - -
@sentry/browser (incl. Tracing, Replay) 88.23 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.63 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.93 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.85 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.94 kB - -
@sentry/vue 35.73 kB - -
@sentry/vue (incl. Tracing) 51.02 kB - -
@sentry/svelte 28.59 kB - -
CDN Bundle 30.35 kB - -
CDN Bundle (incl. Tracing) 49.38 kB - -
CDN Bundle (incl. Logs, Metrics) 32.58 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.25 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.17 kB - -
CDN Bundle (incl. Tracing, Replay) 86.86 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.73 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.8 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.64 kB - -
CDN Bundle - uncompressed 89.95 kB - -
CDN Bundle (incl. Tracing) - uncompressed 147.2 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.24 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.89 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.41 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.69 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.37 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 280.4 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 286.06 kB - -
@sentry/nextjs (client) 53.56 kB - -
@sentry/sveltekit (client) 49.19 kB - -
@sentry/core/server 65.67 kB - -
@sentry/core/browser 51.86 kB - -
@sentry/node 123.8 kB +0.05% +53 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.53 kB - -
@sentry/node - without tracing 88.03 kB +0.02% +16 B 🔺
@sentry/node - without channel injection 103.22 kB +0.06% +55 B 🔺
@sentry/aws-serverless 96.42 kB +0.03% +27 B 🔺
@sentry/cloudflare (withSentry) - minified 201.04 kB - -
@sentry/cloudflare (withSentry) 500.26 kB - -

View base workflow run

@Lms24 Lms24 self-assigned this Aug 31, 2026
Mongoose spans wrap an ODM-level operation. With span streaming enabled:

- mongoose spans become `{db.operation.name} {db.collection.name}`, e.g.
  `findOne blogposts`
- falls back to `db.namespace`, then to `db.system.name`
- `traceLifecycle: 'static'` keeps the existing `mongoose.<Model>.<op>` names

Also corrects `db.system.name` on the monkey-patch path from `mongoose` to
`mongodb`, matching the diagnostics-channel path.

Refs #23523

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Lms24
Lms24 force-pushed the lms/feat-core-mongoose-low-card-span-names branch from 9290d85 to 797e077 Compare August 31, 2026 16:55
@Lms24
Lms24 marked this pull request as ready for review August 31, 2026 16:55
@Lms24
Lms24 requested review from a team as code owners August 31, 2026 16:55
@Lms24
Lms24 requested review from isaacs and mydea and removed request for a team August 31, 2026 16:55
@Lms24 Lms24 changed the title feat(core): Emit low cardinality mongoose span names feat(core): Emit low cardinality mongoose db span names Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant