Skip to content

fix(go-sdk): document SetAttributes/RemoveAttribute and Extra deprecation migration#79

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/update-sentry-go-sdk-for-api-changes
Draft

fix(go-sdk): document SetAttributes/RemoveAttribute and Extra deprecation migration#79
Copilot wants to merge 2 commits intomainfrom
copilot/update-sentry-go-sdk-for-api-changes

Conversation

Copy link
Contributor

Copilot AI commented Mar 24, 2026

PR getsentry/sentry-go#1224 formally deprecated Scope.SetExtra, SetExtras, and RemoveExtra and added Scope.RemoveAttribute. The skill's scope API reference was missing the new method and lacked migration guidance.

Changes to references/error-monitoring.md

  • Scope API table: Added SetAttributes and RemoveAttribute; moved SetExtra/SetExtras/RemoveExtra into a clearly marked deprecated section with inline migration pointers
  • Migration block: Added concrete before/after examples covering both use cases (error events → SetTag/SetContext, logs & metrics → SetAttributes/RemoveAttribute)
  • Best Practices: Replaced the vague "Extra is deprecated" note with two specific guidelines distinguishing error-event enrichment from attribute-based log/metric enrichment
// Before (deprecated)
scope.SetExtra("key.string", "str")

// After — error events:
scope.SetTag("key.string", "str")
scope.SetContext("my_data", sentry.Context{"key.int": 42})

// After — logs and metrics:
scope.SetAttributes(attribute.String("key.string", "str"))
scope.RemoveAttribute("key.string")
Original prompt

This section details on the original issue you should resolve

<issue_title>[skill-drift] sentry-go-sdk may need updates</issue_title>
<issue_description>cc @getsentry/team-web-sdk-backend

SDK Changes Detected

The following PR was merged to getsentry/sentry-go in the last 7 days that may affect the sentry-go-sdk skill:

Potential Skill Gaps

  1. Deprecated APIs: PR #1224 formally deprecates Scope.SetExtra, Scope.SetExtras, and Scope.RemoveExtra in favor of Scope.SetAttributes and Scope.RemoveAttribute. The skill's references/error-monitoring.md already notes SetExtra as deprecated, but the scope API table (line 293) does not yet reflect the full migration path or the new RemoveAttribute method.

  2. New API: Scope.RemoveAttribute is now a public method and part of the recommended API. It is not listed in the scope API reference table in references/error-monitoring.md.

    The recommended migration path from the PR:

    • For error events: use SetTag / SetContext instead of SetExtra
    • For logs and metrics: use SetAttributes / RemoveAttribute
    // Before (deprecated)
    scope.SetExtra("key.string", "str")
    scope.SetExtra("key.int", 42)
    
    // After (for error events)
    scope.SetTag("key.string", "str")
    scope.SetContext("my_data", sentry.Context{"key.int": 42})
    
    // After (for logs and metrics)
    scope.SetAttributes(
        attribute.String("key.string", "str"),
        attribute.Int("key.int", 42),
    )

Skill Files to Review

  • skills/sentry-go-sdk/references/error-monitoring.md

Priority

MEDIUM — Formal deprecation of public API with migration guidance that the skill should reflect accurately.

Generated by SDK Skill Drift Detector ·

  • expires on Apr 6, 2026, 11:02 PM UTC

Comments on the Issue (you are @copilot in this section)

Custom agent used: skill-updater
Expert Sentry SDK skill author that updates and creates SDK skill bundles. Specializes in researching SDK changes, verifying APIs against official docs and source code, and producing high-quality wizard flows with deep-dive reference files. Use when updating skills after SDK changes, creating new skills for new platforms, or fixing skill drift issues.


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

…ion for SetExtra APIs

Co-Authored-By: Claude (Sonnet 4) <noreply@anthropic.com>

Co-authored-by: HazAT <363802+HazAT@users.noreply.github.com>
Agent-Logs-Url: https://github.com/getsentry/sentry-for-ai/sessions/9d433766-e191-46c6-b0e3-4fc9395ce9eb
Copilot AI changed the title [WIP] Update sentry-go-sdk for new and deprecated API changes fix(go-sdk): document SetAttributes/RemoveAttribute and Extra deprecation migration Mar 24, 2026
Copilot AI requested a review from HazAT March 24, 2026 15:50
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.

[skill-drift] sentry-go-sdk may need updates

2 participants