Skip to content

feat(deps): Bump OpenTelemetry dependencies#20786

Open
andreiborza wants to merge 2 commits into
developfrom
ab/bump-otel
Open

feat(deps): Bump OpenTelemetry dependencies#20786
andreiborza wants to merge 2 commits into
developfrom
ab/bump-otel

Conversation

@andreiborza
Copy link
Copy Markdown
Member

@andreiborza andreiborza commented May 11, 2026

Updates OpenTelemetry dependencies to their latest. Even though we are decoupling from OTel in the future we should keep up to date until then so users get all benefits, e.g. support vor amqplib v1.

TraceState changes

@opentelemetry/core 2.7.1 added strict W3C validation to TraceState.set(), rejecting invalid keys with dots and values with ,, = or exceeding 256 characters.

This affects the keys we used previously (e.g. sentry.dsc contains a dot) and the DSC was stored as a single serialized baggage string containing commas and equals. They also exceed the 256-char limit for typical production payloads.

We considered pinning @opentelemetry/core to 2.7.0, this however means we can't update any instrumentations until our next major v11 because many instrumentations use exact versions of @opentelemetry/core. This also locks us out of supporting newer versions of libraries, e.g. amqplib > 1.0 is only supported on newer version of @opentelemetry/instrumentation-amqplib.

Instead, we are updating our keys and values to be W3C compliant. These are only used in-memory and do not get serialized and exported as a tracestate header so it should be a transparent change with baggage being reconstructed down the line.

  • We renamed keys from dots to hyphens (e.g. sentry.sample_rate becomes sentry-sample_rate)
  • We split DSC into individual tracestate entries (e.g. sentry-dsc-environment=production) instead of one serialized string to avoid the 256-char limit and invalid character usage
  • We encode/decode individual values for fields that may contain invalid charactes (e.g. transaction names with =)

The caveat is a small increase of about 100~600 bytes in bundle size across packages.

Bump log

  • Bump @opentelemetry/core from 2.6.1 to 2.7.1
  • Bump @opentelemetry/exporter-trace-otlp-http from 0.214.0 to 0.217.0
  • Bump @opentelemetry/instrumentation from 0.214.0 to 0.217.0
  • Bump @opentelemetry/instrumentation-amqplib from 0.61.0 to 0.64.0
  • Bump @opentelemetry/instrumentation-aws-sdk from 0.69.0 to 0.72.0
  • Bump @opentelemetry/instrumentation-connect from 0.57.0 to 0.60.0
  • Bump @opentelemetry/instrumentation-dataloader from 0.31.0 to 0.34.0
  • Bump @opentelemetry/instrumentation-fs from 0.33.0 to 0.36.0
  • Bump @opentelemetry/instrumentation-generic-pool from 0.57.0 to 0.60.0
  • Bump @opentelemetry/instrumentation-graphql from 0.62.0 to 0.65.0
  • Bump @opentelemetry/instrumentation-hapi from 0.60.0 to 0.63.0
  • Bump @opentelemetry/instrumentation-http from 0.214.0 to 0.217.0
  • Bump @opentelemetry/instrumentation-kafkajs from 0.23.0 to 0.26.0
  • Bump @opentelemetry/instrumentation-knex from 0.58.0 to 0.61.0
  • Bump @opentelemetry/instrumentation-koa from 0.62.0 to 0.65.0
  • Bump @opentelemetry/instrumentation-lru-memoizer from 0.58.0 to 0.61.0
  • Bump @opentelemetry/instrumentation-mongodb from 0.67.0 to 0.70.0
  • Bump @opentelemetry/instrumentation-mongoose from 0.60.0 to 0.63.0
  • Bump @opentelemetry/instrumentation-mysql from 0.60.0 to 0.63.0
  • Bump @opentelemetry/instrumentation-mysql2 from 0.60.0 to 0.63.0
  • Bump @opentelemetry/instrumentation-nestjs-core from 0.60.0 to 0.63.0
  • Bump @opentelemetry/instrumentation-pg from 0.66.0 to 0.69.0
  • Bump @opentelemetry/instrumentation-tedious from 0.33.0 to 0.36.0
  • Bump @opentelemetry/instrumentation-undici from 0.24.0 to 0.27.0
  • Bump @opentelemetry/resources from 2.6.1 to 2.7.1
  • Bump @opentelemetry/sdk-node from 0.214.0 to 0.217.0
  • Bump @opentelemetry/sdk-trace-base from 2.6.1 to 2.7.1
  • Bump @opentelemetry/sdk-trace-node from 2.6.1 to 2.7.1
  • Bump @prisma/instrumentation from 7.6.0 to 7.8.0
  • Bump @fastify/otel from 0.18.0 to 0.18.1

Bumps: 9a2ab78
TraceState changes: 4674f00

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 26.79 kB -0.22% -58 B 🔽
@sentry/browser - with treeshaking flags 25.22 kB -0.25% -62 B 🔽
@sentry/browser (incl. Tracing) 44.84 kB +0.25% +110 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 46.83 kB +0.22% +102 B 🔺
@sentry/browser (incl. Tracing, Profiling) 49.83 kB +0.22% +106 B 🔺
@sentry/browser (incl. Tracing, Replay) 84.46 kB +0.11% +86 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 73.9 kB +0.12% +83 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 89.16 kB +0.1% +86 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 101.79 kB +0.08% +77 B 🔺
@sentry/browser (incl. Feedback) 43.96 kB -0.16% -67 B 🔽
@sentry/browser (incl. sendFeedback) 31.6 kB -0.2% -62 B 🔽
@sentry/browser (incl. FeedbackAsync) 36.7 kB -0.17% -62 B 🔽
@sentry/browser (incl. Metrics) 27.85 kB -0.3% -83 B 🔽
@sentry/browser (incl. Logs) 27.99 kB -0.32% -89 B 🔽
@sentry/browser (incl. Metrics & Logs) 28.67 kB -0.29% -83 B 🔽
@sentry/react 28.52 kB -0.23% -64 B 🔽
@sentry/react (incl. Tracing) 47.11 kB +0.22% +100 B 🔺
@sentry/vue 31.69 kB -0.2% -63 B 🔽
@sentry/vue (incl. Tracing) 46.7 kB +0.24% +109 B 🔺
@sentry/svelte 26.81 kB -0.21% -55 B 🔽
CDN Bundle 29.33 kB +0.33% +96 B 🔺
CDN Bundle (incl. Tracing) 47.25 kB +0.2% +92 B 🔺
CDN Bundle (incl. Logs, Metrics) 30.7 kB +0.32% +95 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 48.38 kB +0.21% +100 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 70.05 kB +0.16% +109 B 🔺
CDN Bundle (incl. Tracing, Replay) 84.65 kB +0.12% +94 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 85.7 kB +0.09% +77 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 90.44 kB +0.09% +81 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 91.53 kB +0.08% +66 B 🔺
CDN Bundle - uncompressed 86.28 kB +0.34% +287 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 141.76 kB +0.21% +293 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 90.47 kB +0.32% +287 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 145.22 kB +0.21% +293 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 215.29 kB +0.14% +287 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 260.47 kB +0.12% +293 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 263.92 kB +0.12% +293 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 274.17 kB +0.11% +293 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 277.6 kB +0.11% +293 B 🔺
@sentry/nextjs (client) 49.61 kB +0.18% +86 B 🔺
@sentry/sveltekit (client) 45.34 kB +0.24% +108 B 🔺
@sentry/node-core 61.14 kB +0.52% +316 B 🔺
@sentry/node 166.52 kB +0.34% +555 B 🔺
@sentry/node - without tracing 74.33 kB +0.51% +376 B 🔺
@sentry/aws-serverless 108.54 kB +0.45% +479 B 🔺
@sentry/cloudflare (withSentry) - minified 170.98 kB +0.19% +320 B 🔺
@sentry/cloudflare (withSentry) 431.07 kB +0.14% +601 B 🔺

View base workflow run

Copy link
Copy Markdown
Member

@JPeer264 JPeer264 left a comment

Choose a reason for hiding this comment

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

I have just 3 comments which are all the same.

// In OTEL we store the sample rand on the trace state because we cannot access scopes for NonRecordingSpans
// The Sentry OTEL SpanSampler takes care of writing the sample rand on the root span
traceState?.get('sentry.sample_rand') ??
traceState?.get('sentry-sample_rand') ??
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

q: Shouldn't it be sentry-dsc-sample_rand? The prefix seems to be sentry-dsc-

Copy link
Copy Markdown
Member Author

@andreiborza andreiborza May 12, 2026

Choose a reason for hiding this comment

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

No, that's different from the DSC.

Basically what we mapped to was

  • sentry. -> sentry- and
  • sentry.dsc was split into sentry-dsc-* entries.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Alright perfect

// This is so that the downstream traces/services can use parentSampleRate in their `tracesSampler` to make consistent sampling decisions across the entire trace.
const rootSpanSampleRate =
traceState?.get('sentry.sample_rate') ??
traceState?.get('sentry-sample_rate') ??
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

q: Shouldn't it be sentry-dsc-sample_rand? The prefix seems to be sentry-dsc-

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

expect(actual.traceState?.get('sentry.sampled_not_recording')).toBe('1');
expect(actual.traceState?.get('sentry.sample_rand')).toEqual(expect.any(String));
expect(actual.traceState?.get('sentry-sampled_not_recording')).toBe('1');
expect(actual.traceState?.get('sentry-sample_rand')).toEqual(expect.any(String));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

q: Also here, sentry-dsc- prefix?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@andreiborza andreiborza requested a review from JPeer264 May 12, 2026 11:46
- Bump @opentelemetry/core from 2.6.1 to 2.7.1
- Bump @opentelemetry/exporter-trace-otlp-http from 0.214.0 to 0.217.0
- Bump @opentelemetry/instrumentation from 0.214.0 to 0.217.0
- Bump @opentelemetry/instrumentation-amqplib from 0.61.0 to 0.64.0
- Bump @opentelemetry/instrumentation-aws-sdk from 0.69.0 to 0.72.0
- Bump @opentelemetry/instrumentation-connect from 0.57.0 to 0.60.0
- Bump @opentelemetry/instrumentation-dataloader from 0.31.0 to 0.34.0
- Bump @opentelemetry/instrumentation-fs from 0.33.0 to 0.36.0
- Bump @opentelemetry/instrumentation-generic-pool from 0.57.0 to 0.60.0
- Bump @opentelemetry/instrumentation-graphql from 0.62.0 to 0.65.0
- Bump @opentelemetry/instrumentation-hapi from 0.60.0 to 0.63.0
- Bump @opentelemetry/instrumentation-http from 0.214.0 to 0.217.0
- Bump @opentelemetry/instrumentation-kafkajs from 0.23.0 to 0.26.0
- Bump @opentelemetry/instrumentation-knex from 0.58.0 to 0.61.0
- Bump @opentelemetry/instrumentation-koa from 0.62.0 to 0.65.0
- Bump @opentelemetry/instrumentation-lru-memoizer from 0.58.0 to 0.61.0
- Bump @opentelemetry/instrumentation-mongodb from 0.67.0 to 0.70.0
- Bump @opentelemetry/instrumentation-mongoose from 0.60.0 to 0.63.0
- Bump @opentelemetry/instrumentation-mysql from 0.60.0 to 0.63.0
- Bump @opentelemetry/instrumentation-mysql2 from 0.60.0 to 0.63.0
- Bump @opentelemetry/instrumentation-nestjs-core from 0.60.0 to 0.63.0
- Bump @opentelemetry/instrumentation-pg from 0.66.0 to 0.69.0
- Bump @opentelemetry/instrumentation-tedious from 0.33.0 to 0.36.0
- Bump @opentelemetry/instrumentation-undici from 0.24.0 to 0.27.0
- Bump @opentelemetry/resources from 2.6.1 to 2.7.1
- Bump @opentelemetry/sdk-node from 0.214.0 to 0.217.0
- Bump @opentelemetry/sdk-trace-base from 2.6.1 to 2.7.1
- Bump @opentelemetry/sdk-trace-node from 2.6.1 to 2.7.1
- Bump @prisma/instrumentation from 7.6.0 to 7.8.0
- Bump @fastify/otel from 0.18.0 to 0.18.1
`@opentelemetry/core` 2.7.1 added strict W3C validation to `TraceState.set()`,
rejecting invalid keys with dots and values with `,`, `=` or exceeding 256
characters.

This affects the keys we used previously (e.g. `sentry.dsc` contains a dot) and
the DSC was stored as a single serialized baggage string containing commas and
equals. They also exceed the 256-char limit for typical production payloads.

We considered pinning `@opentelemetry/core` to 2.7.0, this however means we
can't update any instrumentations until our next major v11 because many
instrumentations use exact versions of `@opentelemetry/core`. This also locks us
out of supporting newer versions of libraries, e.g. amqplib > 1.0 is only
supported on newer version of `@opentelemetry/instrumentation-amqplib`.

Instead, we are updating our keys and values to be W3C compliant. These are only
used in-memory and do not get serialized and exported as a `tracestate` header
so it should be a transparent change.

* We renamed keys from dots to hyphens (e.g. `sentry.sample_rate` becomes
`sentry-sample_rate`)
* We split DSC into individual tracestate entries (e.g.
* `sentry-dsc-environment=production`) instead of one serialized string to avoid
the 256-char limit and invalid character usage
* We encode/decode individual values for fields that may contain invalid
charactes (e.g. transaction names with `=`)
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 4674f00. Configure here.

const url = spanAttributes[SEMATTRS_HTTP_URL] || spanAttributes[ATTR_URL_FULL];
if (url && typeof url === 'string') {
traceState = traceState.set(SENTRY_TRACE_STATE_URL, url);
traceState = traceState.set(SENTRY_TRACE_STATE_URL, encodeURIComponent(url));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Over-aggressive URL encoding may silently exceed TraceState limit

Medium Severity

encodeURIComponent encodes characters like /, :, ?, @ that are already valid in W3C tracestate values (which only forbid , and =). This unnecessary expansion can push URLs and DSC transaction values past the 256-char tracestate value limit, causing TraceState.set() in OTel 2.7.1 to silently return the same instance (no-op). For unsampled spans where the URL is only available via trace state, this silently breaks tracePropagationTargets filtering. A more targeted encoding escaping only , and = would avoid this.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4674f00. Configure here.

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.

2 participants