Skip to content

feat: add RemoveAttribute api on the scope#1224

Merged
giortzisg merged 4 commits intomasterfrom
feat/remove-attr
Mar 18, 2026
Merged

feat: add RemoveAttribute api on the scope#1224
giortzisg merged 4 commits intomasterfrom
feat/remove-attr

Conversation

@giortzisg
Copy link
Contributor

@giortzisg giortzisg commented Mar 11, 2026

Description

This PR adds RemoveAttribute on the scope, to complete the API according to the spec. Also adds deprecation warning for SetExtra and RemoveExtra and updates all examples to use the recommended API.

Issues

Changelog Entry Instructions

To add a custom changelog entry, uncomment the section above. Supports:

  • Single entry: just write text
  • Multiple entries: use bullet points
  • Nested bullets: indent 4+ spaces

For more details: custom changelog entries

Reminders

Changelog Entry

  • Add RemoveAttribute api on the scope.
  • Deprecate Scope.SetExtra, Scope.SetExtras, and Scope.RemoveExtra in favor of Scope.SetAttributes and Scope.RemoveAttribute
    • The recommended migration path is to use SetAttributes to attach values to logs and metrics. Note that attributes do not appear on error events; if you only capture errors, use SetTag or SetContext instead.
    • Before:
    scope.SetExtra("key.string", "str")
    scope.SetExtra("key.int", 42)
    • After (for error events) — use tags and contexts:
    scope.SetTag("key.string", "str")
    scope.SetContext("my_data", sentry.Context{"key.int": 42})
    • After (for logs and metrics) — use attributes:
    scope.SetAttributes(
        attribute.String("key.string", "str"),
        attribute.Int("key.int", 42),
    )

@giortzisg giortzisg self-assigned this Mar 11, 2026
@github-actions
Copy link

github-actions bot commented Mar 11, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • Add RemoveAttribute api on the scope. by giortzisg in #1224
  • Deprecate Scope.SetExtra, Scope.SetExtras, and Scope.RemoveExtra in favor of Scope.SetAttributes and Scope.RemoveAttribute by giortzisg in #1224
    • The recommended migration path is to use SetAttributes to attach values to logs and metrics. Note that attributes do not appear on error events; if you only capture errors, use SetTag or SetContext instead.
    • Before:
    scope.SetExtra("key.string", "str")
    scope.SetExtra("key.int", 42)
    • After (for error events) — use tags and contexts:
    scope.SetTag("key.string", "str")
    scope.SetContext("my_data", sentry.Context{"key.int": 42})
    • After (for logs and metrics) — use attributes:
    scope.SetAttributes(
        attribute.String("key.string", "str"),
        attribute.Int("key.int", 42),
    )
  • Add support for homogenous arrays by giortzisg in #1203
  • Add support for client reports by giortzisg in #1192
  • Add org id propagation in sentry_baggage by giortzisg in #1210
  • Add OrgID and StrictTraceContinuation client options. by giortzisg in #1210
  • Add the option to set attributes on the scope by giortzisg in #1208

Bug Fixes 🐛

  • (serialization) Pre-serialize mutable event fields to prevent race panics by giortzisg in #1214
  • Use HEROKU_BUILD_COMMIT with HEROKU_SLUG_COMMIT as fallback by ericapisani in #1220

Internal Changes 🔧

Ai

  • Add AGENTS.md and testing guidelines by giortzisg in #1216
  • Add dotagents configuration by giortzisg in #1211

Other

  • (deps) Bump github.com/gofiber/fiber/v2 from 2.52.11 to 2.52.12 in /fiber by dependabot in #1209
  • Bump getsentry/craft to 2.24.1 by giortzisg in #1225
  • Handle independent go module versions for integrations by giortzisg in #1217

🤖 This preview updates automatically when you update the PR.

Copy link

@Litarnus Litarnus left a comment

Choose a reason for hiding this comment

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

LGTM

@giortzisg giortzisg merged commit df391b0 into master Mar 18, 2026
23 checks passed
@giortzisg giortzisg deleted the feat/remove-attr branch March 18, 2026 09:29
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