Skip to content

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

Open
twmb wants to merge 2 commits into
mainfrom
sentry-migrate-off-setextras
Open

sentry: migrate off removed SetExtras API and bump sentry-go to v0.47.0#4549
twmb wants to merge 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

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>
@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

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@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

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.

1 participant