Skip to content

Update module github.com/getsentry/sentry-go/otel to v0.49.0 - #6592

Open
renovate[bot] wants to merge 7 commits into
mainfrom
renovate/github.com-getsentry-sentry-go-otel-0.x
Open

Update module github.com/getsentry/sentry-go/otel to v0.49.0#6592
renovate[bot] wants to merge 7 commits into
mainfrom
renovate/github.com-getsentry-sentry-go-otel-0.x

Conversation

@renovate

@renovate renovate Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Renovate bump of github.com/getsentry/sentry-go/otel v0.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 through sentry.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:

  • Sampling--sentry-traces-sample-rate became a no-op. A bare BatchSpanProcessor does no sampling, and NewServeProvider forces 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.
  • Grouping attributes — exported spans lost Environment, Release and the anonymous instance ID, so --sentry-environment no longer segregated Traces and Issues/Traces disagreed on both. These now travel as OTEL resource attributes.
  • Duplicate registrationNewBatchSpanProcessor returns a fresh pointer per call, defeating the registry's pointer-identity dedup. A second Init registered a second processor, double-exported every span and leaked the first exporter's goroutine. The processor is now created once per process.
  • Deprecated SendDefaultPII — v0.49.0 deprecated it, failing the lint job. Not a straight swap: SendDefaultPII: false also installs an extended deny-list (forwarding headers, remote addresses, user identifiers) that sentry-go keeps in an unexported field DataCollection cannot reach, so setting DataCollection naively would have quietly stopped scrubbing client IPs. The list is reproduced as per-behaviour Terms, which the SDK ORs with its built-in terms.

CaptureException also switches to CaptureEventWithHint with hint.Context. The new linking integration reads the trace from the hint context or scope.request, and ToolHive registers no sentryhttp middleware, so plain hub.CaptureException would have left Issues with no trace linkage.

Type of change

  • Dependency update

Test plan

  • Unit tests (task test) — full suite green with -race
  • Linting — 0 issues across ./... with golangci-lint v2.13.2, the version CI pins

Every regression above has a test that was confirmed to fail against the pre-fix code, not just to pass after it. The DataCollection migration 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-rate is 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 serve runs 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.

piiSensitiveTerms in pkg/sentry/sentry.go duplicates 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:

Package Change Age Confidence
github.com/getsentry/sentry-go/otel v0.44.1v0.49.0 age confidence

Release Notes

getsentry/sentry-go (github.com/getsentry/sentry-go/otel)

v0.49.0: 0.49.0

Compare Source

Breaking Changes 🛠
  • removing DisableLogs and DisableMetrics client options. Sending metrics and logs is already gated by the usage of our APIs already, so having a global kill switch is counter intuitive. Users that won't to opt out should just not call the relevant APIs or setup the integrations. by @​giortzisg in #​1392
New Features ✨
  • add WithProxyoption for OTLP. This allows setting an otlptracehttp.HTTPTransportProxyFunc for the span exporter by @​pierrre in #​1377
Bug Fixes 🐛
  • (echo) Propagate span through request context by @​EricGusmao in #​1385
  • Skip recover frames on panic. This changes stacktrace behavior for captured panics, removing sentry.Recover frames to focus on the actual panic frames. The changes might affect issue grouping. by @​giortzisg in #​1364
Internal Changes 🔧
Deps

v0.48.0: 0.48.0

Compare Source

Breaking Changes 🛠
New Features ✨
  • Add ClientOptions.DataCollection for granular control over data collected by automatic instrumentation, replacing the broad SendDefaultPII switch. DataCollection can independently configure automatic user.* population, cookies, request/response headers, HTTP bodies, and query parameters. When configured, it is the source of truth and SendDefaultPII is ignored. by @​giortzisg in #​1339
    • For backwards compatibility, clients that do not configure DataCollection keep a best-effort mapping of the previous SendDefaultPII behavior. To opt in to the new defaults, pass an empty DataCollection and then restrict individual categories as needed.
    sentry.Init(sentry.ClientOptions{
        Dsn: "https://public@example.com/1",
    
        // Opt in to the new data collection defaults. Omitted fields use their
        // defaults: user info, cookies, headers, query params, and supported HTTP
        // bodies are collected, with sensitive values filtered.
        DataCollection: &sentry.DataCollection{},
    })
    • To opt in while disabling automatic user info and HTTP bodies, configure those fields explicitly:
    sentry.Init(sentry.ClientOptions{
        Dsn: "https://public@example.com/1",
        DataCollection: &sentry.DataCollection{
            UserInfo:   sentry.Set(false),
            HTTPBodies: []sentry.BodyType{},
        },
    })
  • PushScope shorthand now returns the new scope reference by @​DoctorJohn in #​1335
Bug Fixes 🐛
Internal Changes 🔧
Deps
Other

v0.47.0: 0.47.0

Compare Source

Breaking Changes 🛠
  • Fix transaction_info source 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 #​1325
  • remove deprecatedotel.NewSentrySpanProcessor. Users should now use the sentryotlp.NewTraceExporter instead by @​giortzisg in #​1307
    // Before
    sentry.Init(sentry.ClientOptions{Dsn: dsn, EnableTracing: true, TracesSampleRate: 1.0})
    
    tp := sdktrace.NewTracerProvider(
    	sdktrace.WithSpanProcessor(sentryotel.NewSentrySpanProcessor()),
    )
    otel.SetTextMapPropagator(sentryotel.NewSentryPropagator())
    otel.SetTracerProvider(tp)
    
    // After:
    sentry.Init(sentry.ClientOptions{
    	Dsn: dsn, EnableTracing: true, TracesSampleRate: 1.0,
    	Integrations: func(i []sentry.Integration) []sentry.Integration {
    		return append(i, sentryotel.NewOtelIntegration())
    	},
    })
    
    exporter, _ := sentryotlp.NewTraceExporter(ctx, dsn)
    tp := sdktrace.NewTracerProvider(sdktrace.WithBatcher(exporter))
    otel.SetTracerProvider(tp)
  • Enable logs by default to skip double allow behavior. Enabling logs now happens once when setting up either sentry.NewLogger or any supported integration. Also the EnableLogs flag changes to DisableLogs for a global override switch by @​giortzisg in #​1306
  • Remove the ContextifyFrames integration. The recommended way to add source context is SCM by @​giortzisg in #​1302
New Features ✨
  • Add fiber v3 integration by @​giortzisg in #​1324
  • Bump fasthttp from 1.51.0 to 1.71.0 by @​giortzisg in #​1324
  • Add sentrysql SQL tracing integration by @​giortzisg in #​1305
    • Supports multiple integration paths depending on how your app opens database connections: sentrysql.Open(...), sentrysql.OpenDB(...), and wrapped drivers/connectors for custom setups.
    • Database metadata is not inferred in every setup. If the database name is not discoverable automatically, pass sentrysql.WithDatabaseName(...) so spans are populated correctly.
    • Example:
     // Simple driver-based setup
     db, err := sentrysql.Open("sqlite", ":memory:",
         sentrysql.WithDatabaseSystem(sentrysql.SystemSQLite),
         sentrysql.WithDatabaseName("main"),
     )
Internal Changes 🔧
Deps
Other

v0.46.2: 0.46.2

Compare Source

Bug Fixes 🐛

v0.46.1: 0.46.1

Compare Source

Bug Fixes 🐛

v0.46.0: 0.46.0

Compare Source

Breaking Changes 🛠
New Features ✨
Internal Changes 🔧
Deps
Other

v0.45.1: 0.45.1

Compare Source

Bug Fixes 🐛

v0.45.0: 0.45.0

Compare Source

Breaking Changes 🛠
New Features ✨
  • Add OTLP trace exporter via new otel/otlp sub-module by @​giortzisg in #​1229
    • sentryotlp.NewTraceExporter sends OTel spans directly to Sentry's OTLP endpoint.
    • sentryotel.NewOtelIntegration links Sentry errors, logs, and metrics to the active OTel trace. Works with both direct-to-Sentry and collector-based setups.
    • NewSentrySpanProcessor, NewSentryPropagator, and SentrySpanMap are deprecated and will be removed in 0.47.0. To Migrate use sentryotlp.NewTraceExporter instead:
    // Before
    sentry.Init(sentry.ClientOptions{Dsn: dsn, EnableTracing: true, TracesSampleRate: 1.0})
    
    tp := sdktrace.NewTracerProvider(
    	sdktrace.WithSpanProcessor(sentryotel.NewSentrySpanProcessor()),
    )
    otel.SetTextMapPropagator(sentryotel.NewSentryPropagator())
    otel.SetTracerProvider(tp)
    
    // After:
    sentry.Init(sentry.ClientOptions{
    	Dsn: dsn, EnableTracing: true, TracesSampleRate: 1.0,
    	Integrations: func(i []sentry.Integration) []sentry.Integration {
    		return append(i, sentryotel.NewOtelIntegration())
    	},
    })
    
    exporter, _ := sentryotlp.NewTraceExporter(ctx, dsn)
    tp := sdktrace.NewTracerProvider(sdktrace.WithBatcher(exporter))
    otel.SetTracerProvider(tp)
  • Add IsSensitiveHeader helper to easily distinguish which headers to scrub for PII. by @​giortzisg in #​1239
Bug Fixes 🐛
Internal Changes 🔧
Deps
Other

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • "every weekend"
  • Automerge
    • At any time (no schedule defined)

🚦 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the dependencies Pull requests that update a dependency file label Sep 9, 2026
@renovate
renovate Bot requested a review from JAORMX as a code owner September 9, 2026 16:54
@renovate

renovate Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

ℹ️ Artifact update notice

File name: go.mod

In order to perform the update(s) described in the table above, Renovate ran the go get command, which resulted in the following additional change(s):

  • 1 additional dependency was updated

Details:

Package Change
github.com/getsentry/sentry-go v0.47.0 -> v0.49.0

@renovate renovate Bot added the dependencies Pull requests that update a dependency file label Sep 9, 2026
@github-actions github-actions Bot added the size/XS Extra small PR: < 100 lines changed label Sep 9, 2026
@renovate
renovate Bot force-pushed the renovate/github.com-getsentry-sentry-go-otel-0.x branch from 8221f2b to ef8cc73 Compare September 10, 2026 08:14
@github-actions github-actions Bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Sep 10, 2026
@github-actions github-actions Bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Sep 10, 2026
@renovate

renovate Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Edited/Blocked Notification

Renovate 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.

⚠️ Warning: custom changes will be lost.

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.73469% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.84%. Comparing base (1f87350) to head (1cdcabb).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
pkg/telemetry/serve.go 42.85% 8 Missing ⚠️
pkg/sentry/sentry.go 90.38% 5 Missing ⚠️
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.
📢 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.

@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Sep 10, 2026
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>
@rdimitrov
rdimitrov requested a review from jerm-dro as a code owner September 10, 2026 09:39
@github-actions github-actions Bot added size/L Large PR: 600-999 lines changed and removed size/S Small PR: 100-299 lines changed labels Sep 10, 2026
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>
@github-actions github-actions Bot added size/L Large PR: 600-999 lines changed and removed size/L Large PR: 600-999 lines changed labels Sep 10, 2026
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>
@github-actions github-actions Bot added size/L Large PR: 600-999 lines changed and removed size/L Large PR: 600-999 lines changed labels Sep 10, 2026
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>
@github-actions github-actions Bot added size/L Large PR: 600-999 lines changed and removed size/L Large PR: 600-999 lines changed labels Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file size/L Large PR: 600-999 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant