Update module github.com/getsentry/sentry-go/otel to v0.49.0 - #6592
Open
renovate[bot] wants to merge 7 commits into
Open
Update module github.com/getsentry/sentry-go/otel to v0.49.0#6592renovate[bot] wants to merge 7 commits into
renovate[bot] wants to merge 7 commits into
Conversation
Contributor
Author
ℹ️ Artifact update noticeFile name: go.modIn order to perform the update(s) described in the table above, Renovate ran the
Details:
|
renovate
Bot
force-pushed
the
renovate/github.com-getsentry-sentry-go-otel-0.x
branch
from
September 10, 2026 08:14
8221f2b to
ef8cc73
Compare
Contributor
Author
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6592 +/- ##
==========================================
- Coverage 78.89% 78.84% -0.05%
==========================================
Files 778 778
Lines 77598 77685 +87
==========================================
+ Hits 61219 61252 +33
- Misses 16374 16428 +54
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rdimitrov
requested review from
ChrisJBurns,
amirejaz,
aponcedeleonch,
jhrozek,
rdimitrov and
reyortiz3
as code owners
September 10, 2026 08:56
Moving from sentryotel.NewSentrySpanProcessor (removed upstream in v0.47.0) to sentryotlp.NewTraceExporter turned Sentry from an in-process span processor into a plain OTLP exporter. The old processor funnelled every span through sentry.StartTransaction, so it inherited the client's sampler, scope tags, environment and release for free. The exporter never touches the client, so all of that was silently dropped. Apply the Sentry sample rate in the processor itself. A bare BatchSpanProcessor does no sampling, and NewServeProvider forces OTEL sampling to 1.0 in Sentry-only mode, so --sentry-traces-sample-rate had become a no-op and every span was shipped to Sentry regardless of the configured rate. Sampling is derived from the trace ID via ParentBased so whole traces are kept or dropped together and a trace already sampled upstream is preserved. This restores the per-processor sampling invariant NewServeProvider had already documented. Carry environment, release and instance ID as OTEL resource attributes. Without them Issues and Traces disagreed on all three, and --sentry-environment no longer segregated traces in the Sentry UI. They are registered through the same self-registration seam as the span processor, so the OTEL provider setup stays free of Sentry specifics. Create the span processor once per process. The registry deduplicates by pointer identity and NewBatchSpanProcessor allocates a fresh pointer on every call, so a second Init registered a duplicate processor, double-exported every span and leaked the first exporter's goroutine. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Replace the custom sampling span processor with a sampling rate handed to the OTEL SDK sampler. Both approaches make --sentry-traces-sample-rate effective again, but the SDK sampler runs before span creation, so unsampled spans are never constructed rather than being built at 100% and discarded on export. That removes the throughput caveat processor-only mode had to document, and drops a SpanProcessor implementation in favour of a config value. The tradeoff is that the SDK sampler is shared by the whole provider, so Sentry no longer gets a rate independent of a configured OTLP collector; when an endpoint is set, its rate wins. Only processor-only mode, which is how thv serve runs Sentry, honours the registered rate. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sampling now happens in the shared SDK sampler, so once an OTLP endpoint is configured the endpoint's rate applies to every backend and an integration's own rate cannot be honoured. Sentry then receives everything that sampler passes rather than its own share of it, which is more traces than --sentry-traces-sample-rate asked for. Restoring independent per-backend rates needs a sampling span processor, which is more machinery than the case warrants. Log the conflict at startup instead so the behaviour is visible rather than silent, and keep serving: exporting more traces than requested is not worth refusing to start over. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The v0.49.0 bump deprecated ClientOptions.SendDefaultPII, failing the lint job. Migrating is not a straight swap: SendDefaultPII=false also installs an extended deny-list covering forwarding headers, remote addresses and user identifiers, and sentry-go keeps that list in an unexported field the DataCollection API cannot reach. Setting DataCollection naively would have quietly stopped scrubbing client IPs from an API server that usually sits behind a proxy. Reproduce the list as per-behaviour Terms instead. In CollectionDenyList mode the SDK ORs a behaviour's Terms with its built-in terms, so filtering is unchanged; verified by comparing the resolved DataCollection of both configurations field by field. A test pins the result so the PII posture cannot be loosened without a failing assertion. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renovate bump of
github.com/getsentry/sentry-go/otelv0.44.1 → v0.49.0, plus the migration the bump requires.v0.47.0 removed
sentryotel.NewSentrySpanProcessor, so Sentry moves from an in-process span processor to the OTLP trace exporter (sentryotlp.NewTraceExporter+sentryotel.NewOtelIntegration). That swap is the source of everything else here: the old processor pushed every span throughsentry.StartTransaction, so it inherited the Sentry client's sampler, environment, release and scope tags. The exporter never touches the client, so all of that was silently lost and needed restoring:--sentry-traces-sample-ratebecame a no-op. A bareBatchSpanProcessordoes no sampling, andNewServeProviderforces OTEL sampling to 1.0 in Sentry-only mode, so every span was shipped to Sentry regardless of the configured rate. The rate now goes to the OTEL SDK sampler, so unsampled spans are never constructed at all.Environment,Releaseand the anonymous instance ID, so--sentry-environmentno longer segregated Traces and Issues/Traces disagreed on both. These now travel as OTEL resource attributes.NewBatchSpanProcessorreturns a fresh pointer per call, defeating the registry's pointer-identity dedup. A secondInitregistered a second processor, double-exported every span and leaked the first exporter's goroutine. The processor is now created once per process.SendDefaultPII— v0.49.0 deprecated it, failing the lint job. Not a straight swap:SendDefaultPII: falsealso installs an extended deny-list (forwarding headers, remote addresses, user identifiers) that sentry-go keeps in an unexported fieldDataCollectioncannot reach, so settingDataCollectionnaively would have quietly stopped scrubbing client IPs. The list is reproduced as per-behaviourTerms, which the SDK ORs with its built-in terms.CaptureExceptionalso switches toCaptureEventWithHintwithhint.Context. The new linking integration reads the trace from the hint context orscope.request, and ToolHive registers nosentryhttpmiddleware, so plainhub.CaptureExceptionwould have left Issues with no trace linkage.Type of change
Test plan
task test) — full suite green with-race./...with golangci-lint v2.13.2, the version CI pinsEvery regression above has a test that was confirmed to fail against the pre-fix code, not just to pass after it. The
DataCollectionmigration was checked by comparing the resolved config of both the old and new options field by field.Does this introduce a user-facing change?
Yes,
--sentry-traces-sample-rateis honoured again. It had silently become a no-op, sending 100% of spans to Sentry. Anyone who set it below 1.0 to control quota will see their Sentry trace volume drop to what they originally asked for.Special notes for reviewers
One deliberate behaviour change worth a look: sampling now happens in the OTEL SDK sampler, which is shared by the whole provider, so Sentry no longer gets a rate independent of a configured OTLP collector. With an endpoint set, the collector's rate applies to every backend and the Sentry rate is ignored — previously the two multiplied. Only processor-only mode (how
thv serveruns Sentry) honours the Sentry rate. A startup warning makes this visible rather than silent. Restoring independent rates would need a custom sampling span processor, which seemed like more machinery than the case warrants.piiSensitiveTermsinpkg/sentry/sentry.goduplicates an unexported upstream list, so a term added by sentry-go will not reach us automatically. Flagged in a comment to re-check on SDK upgrades.This PR contains the following updates:
v0.44.1→v0.49.0Release Notes
getsentry/sentry-go (github.com/getsentry/sentry-go/otel)
v0.49.0: 0.49.0Compare Source
Breaking Changes 🛠
New Features ✨
WithProxyoption for OTLP. This allows setting anotlptracehttp.HTTPTransportProxyFuncfor the span exporter by @pierrre in #1377Bug Fixes 🐛
sentry.Recoverframes to focus on the actual panic frames. The changes might affect issue grouping. by @giortzisg in #1364Internal Changes 🔧
Deps
v0.48.0: 0.48.0Compare Source
Breaking Changes 🛠
New Features ✨
ClientOptions.DataCollectionfor granular control over data collected by automatic instrumentation, replacing the broadSendDefaultPIIswitch.DataCollectioncan independently configure automaticuser.*population, cookies, request/response headers, HTTP bodies, and query parameters. When configured, it is the source of truth andSendDefaultPIIis ignored. by @giortzisg in #1339DataCollectionkeep a best-effort mapping of the previousSendDefaultPIIbehavior. To opt in to the new defaults, pass an emptyDataCollectionand then restrict individual categories as needed.Bug Fixes 🐛
Internal Changes 🔧
Deps
c802283to4013fc6by @dependabot in #1344Other
v0.47.0: 0.47.0Compare Source
Breaking Changes 🛠
transaction_infosource getting set incorrectly across HTTP middleware integrations (http, fasthttp, fiber). Users should now expect traces to properly get grouped with their parameterized path. Transactions in affected integrations may regroup after upgrading. by @giortzisg in #1325otel.NewSentrySpanProcessor. Users should now use thesentryotlp.NewTraceExporterinstead by @giortzisg in #1307sentry.NewLoggeror any supported integration. Also the EnableLogs flag changes to DisableLogs for a global override switch by @giortzisg in #1306ContextifyFramesintegration. The recommended way to add source context is SCM by @giortzisg in #1302New Features ✨
sentrysql.Open(...),sentrysql.OpenDB(...), and wrapped drivers/connectors for custom setups.sentrysql.WithDatabaseName(...)so spans are populated correctly.Internal Changes 🔧
Deps
71588ddtoc802283by @dependabot in #1314Other
v0.46.2: 0.46.2Compare Source
Bug Fixes 🐛
v0.46.1: 0.46.1Compare Source
Bug Fixes 🐛
v0.46.0: 0.46.0Compare Source
Breaking Changes 🛠
New Features ✨
DisableTelemetryBufferflag by @giortzisg in #1254internal/protocol.Dsnand make it safe to access by @giortzisg in #1254Internal Changes 🔧
Deps
Other
v0.45.1: 0.45.1Compare Source
Bug Fixes 🐛
v0.45.0: 0.45.0Compare Source
Breaking Changes 🛠
New Features ✨
sentryotlp.NewTraceExporterinstead:Bug Fixes 🐛
Internal Changes 🔧
Deps
Other
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.