Skip to content

Commit df391b0

Browse files
authored
feat: add RemoveAttribute api on the scope (#1224)
1 parent 340c142 commit df391b0

File tree

18 files changed

+63
-17
lines changed

18 files changed

+63
-17
lines changed

_examples/echo/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func main() {
4949
app.GET("/", func(ctx echo.Context) error {
5050
if hub := sentryecho.GetHubFromContext(ctx); hub != nil {
5151
hub.WithScope(func(scope *sentry.Scope) {
52-
scope.SetExtra("unwantedQuery", "someQueryDataMaybe")
52+
scope.SetTag("unwantedQuery", "someQueryDataMaybe")
5353
hub.CaptureMessage("User provided unwanted query string, but we recovered just fine")
5454
})
5555
}

_examples/fasthttp/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func main() {
5858
defaultHandler := func(ctx *fasthttp.RequestCtx) {
5959
if hub := sentryfasthttp.GetHubFromContext(ctx); hub != nil {
6060
hub.WithScope(func(scope *sentry.Scope) {
61-
scope.SetExtra("unwantedQuery", "someQueryDataMaybe")
61+
scope.SetTag("unwantedQuery", "someQueryDataMaybe")
6262
hub.CaptureMessage("User provided unwanted query string, but we recovered just fine")
6363
})
6464
}

_examples/feature-showcase/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func captureMessage() {
4747

4848
func configureScope() {
4949
sentry.ConfigureScope(func(scope *sentry.Scope) {
50-
scope.SetExtra("oristhis", "justfantasy")
50+
scope.SetTag("oristhis", "justfantasy")
5151
scope.SetTag("isthis", "reallife")
5252
scope.SetLevel(sentry.LevelFatal)
5353
scope.SetUser(sentry.User{
@@ -80,8 +80,8 @@ func addBreadcrumbs() {
8080
func withScopeAndConfigureScope() {
8181
sentry.WithScope(func(scope *sentry.Scope) {
8282
sentry.ConfigureScope(func(scope *sentry.Scope) {
83-
scope.SetExtras(map[string]interface{}{
84-
"istillcant": 42,
83+
scope.SetTags(map[string]string{
84+
"istillcant": "42",
8585
"believe": "that",
8686
})
8787
scope.SetTags(map[string]string{

_examples/fiber/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func main() {
5050
app.All("/", func(ctx *fiber.Ctx) error {
5151
if hub := sentryfiber.GetHubFromContext(ctx); hub != nil {
5252
hub.WithScope(func(scope *sentry.Scope) {
53-
scope.SetExtra("unwantedQuery", "someQueryDataMaybe")
53+
scope.SetTag("unwantedQuery", "someQueryDataMaybe")
5454
hub.CaptureMessage("User provided unwanted query string, but we recovered just fine")
5555
})
5656
}

_examples/gin/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func main() {
4242
app.GET("/", func(ctx *gin.Context) {
4343
if hub := sentrygin.GetHubFromContext(ctx); hub != nil {
4444
hub.WithScope(func(scope *sentry.Scope) {
45-
scope.SetExtra("unwantedQuery", "someQueryDataMaybe")
45+
scope.SetTag("unwantedQuery", "someQueryDataMaybe")
4646
hub.CaptureMessage("User provided unwanted query string, but we recovered just fine")
4747
})
4848
}

_examples/iris/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func main() {
4343
app.Get("/", func(ctx iris.Context) {
4444
if hub := sentryiris.GetHubFromContext(ctx); hub != nil {
4545
hub.WithScope(func(scope *sentry.Scope) {
46-
scope.SetExtra("unwantedQuery", "someQueryDataMaybe")
46+
scope.SetTag("unwantedQuery", "someQueryDataMaybe")
4747
hub.CaptureMessage("User provided unwanted query string, but we recovered just fine")
4848
})
4949
}

_examples/negroni/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func main() {
4444
mux.HandleFunc("/", func(rw http.ResponseWriter, r *http.Request) {
4545
hub := sentry.GetHubFromContext(r.Context())
4646
hub.WithScope(func(scope *sentry.Scope) {
47-
scope.SetExtra("unwantedQuery", "someQueryDataMaybe")
47+
scope.SetTag("unwantedQuery", "someQueryDataMaybe")
4848
hub.CaptureMessage("User provided unwanted query string, but we recovered just fine")
4949
})
5050
rw.WriteHeader(http.StatusOK)

_examples/recover/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func main() {
5050
})
5151

5252
sentry.ConfigureScope(func(scope *sentry.Scope) {
53-
scope.SetExtra("oristhis", "justfantasy")
53+
scope.SetTag("oristhis", "justfantasy")
5454
scope.SetTag("isthis", "reallife")
5555
scope.SetLevel(sentry.LevelFatal)
5656
scope.SetUser(sentry.User{

echo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ app.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
101101
app.GET("/", func(ctx echo.Context) error {
102102
if hub := sentryecho.GetHubFromContext(ctx); hub != nil {
103103
hub.WithScope(func(scope *sentry.Scope) {
104-
scope.SetExtra("unwantedQuery", "someQueryDataMaybe")
104+
scope.SetTag("unwantedQuery", "someQueryDataMaybe")
105105
hub.CaptureMessage("User provided unwanted query string, but we recovered just fine")
106106
})
107107
}

fasthttp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ sentryHandler := sentryfasthttp.New(sentryfasthttp.Options{
9494
defaultHandler := func(ctx *fasthttp.RequestCtx) {
9595
if hub := sentryfasthttp.GetHubFromContext(ctx); hub != nil {
9696
hub.WithScope(func(scope *sentry.Scope) {
97-
scope.SetExtra("unwantedQuery", "someQueryDataMaybe")
97+
scope.SetTag("unwantedQuery", "someQueryDataMaybe")
9898
hub.CaptureMessage("User provided unwanted query string, but we recovered just fine")
9999
})
100100
}

0 commit comments

Comments
 (0)