Skip to content

sentry: migrate off removed SetExtras API and bump sentry-go to v0.47.0 - #4549

Merged
josephwoodward merged 2 commits into
mainfrom
sentry-migrate-off-setextras
Jun 25, 2026
Merged

sentry: migrate off removed SetExtras API and bump sentry-go to v0.47.0#4549
josephwoodward merged 2 commits into
mainfrom
sentry-migrate-off-setextras

Conversation

@twmb

@twmb twmb commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What

Migrate the sentry_capture processor off the Scope.SetExtras API (removed in getsentry/sentry-go v0.47.0) and bump the dependency from v0.44.1 to v0.47.0.

Why

sentry-go v0.47.0 removes the deprecated Scope.SetExtras method and the Event.Extra field entirely. Building Redpanda Connect from source against a current Go module graph picks up the removal and fails to compile.

The obvious Scope.SetAttributes replacement is not a drop-in: attributes only apply to the structured-logging API, never to the error/message events this processor captures (ApplyToEvent ignores them), so using it would silently drop the extras data.

How

Attach the configured extras to the captured event as a context named extras (via Scope.SetContext). sentry.Context is a map[string]any alias, so arbitrary extras values are preserved with no type loss.

⚠️ Behavioral change

The extras data now surfaces under the event's Contexts section in Sentry rather than the legacy Additional Data section. All data is preserved — only its location in the Sentry UI (and the event payload shape) changes. Saved searches or alerts that query the extra.* path may need updating.

🤖 Generated with Claude Code

@claude

claude Bot commented Jun 24, 2026

Copy link
Copy Markdown

Commits
LGTM

Review
Focused, correct migration off the removed sentry-go Scope.SetExtras API to SetContext("extras", ...), with the dependency bump and tests updated to match. extras (map[string]any) is assignable to sentry.Context, the single code path is fully covered, and no other usages of the removed API remain.

LGTM

@claude

claude Bot commented Jun 24, 2026

Copy link
Copy Markdown

Commits
LGTM

Review
Clean, well-scoped migration off the removed sentry-go Scope.SetExtras/Event.Extra API (removed in v0.47.0), attaching extras as a dedicated extras context instead. The dep bump is correctly coupled with its required code change, generated docs are split into a separate commit, and both unit tests were updated to assert against event.Contexts["extras"]. Verified that sentry.Context is a type alias for map[string]interface{}, so both SetContext("extras", extras) compiles and the require.Equal assertions hold.

LGTM

twmb and others added 2 commits June 24, 2026 09:15
sentry-go v0.47.0 removes the deprecated Scope.SetExtras method and the
Event.Extra field (the "extra"/Additional Data concept) in favour of the
attribute API. Attributes only apply to logs, not to the error/message
events captured by this processor, so they are not a drop-in replacement.

Building Redpanda Connect from source against a current Go module graph
therefore picks up the removal and fails to compile on Scope.SetExtras.

Attach the configured extras to the captured event as a context named
"extras" instead. This preserves all extras data (sentry.Context is a
map[string]any alias, so arbitrary values are retained) at the cost of a
user-visible relocation: the data now surfaces under the event's Contexts
section in Sentry rather than the legacy Additional Data section.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@twmb
twmb force-pushed the sentry-migrate-off-setextras branch from 689718b to 07c2cd2 Compare June 24, 2026 15:16
@claude

claude Bot commented Jun 24, 2026

Copy link
Copy Markdown

Commits
LGTM

Review
Small, well-scoped change migrating the sentry_capture processor off the Scope.SetExtras API (removed in sentry-go v0.47.0) by attaching extras as a context named extras, with the dependency bump, test updates, and regenerated docs split into a clean code/docs commit pair. The migration is correct (extras is map[string]any, compatible with the sentry.Context alias passed to SetContext) and the tests are updated to assert on event.Contexts["extras"].

LGTM

@josephwoodward
josephwoodward merged commit 43b02eb into main Jun 25, 2026
9 checks passed
@josephwoodward
josephwoodward deleted the sentry-migrate-off-setextras branch June 25, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants