-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add user ID to sentry telemetry (#142)
- Loading branch information
1 parent
a58bc83
commit 2cde3ab
Showing
4 changed files
with
11 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,7 +77,7 @@ func CaptureError(ctx context.Context, err error) error { | |
type Shutdown func() | ||
|
||
// Init initializes the otel framework. | ||
func Init(ctx context.Context) ([]Shutdown, error) { | ||
func Init(ctx context.Context, userId string) ([]Shutdown, error) { | ||
dsn := "https://[email protected]/4507177762357248" | ||
// TODO: combine telemetry and trace packages? | ||
if telemetry.DNT() { | ||
|
@@ -112,6 +112,10 @@ func Init(ctx context.Context) ([]Shutdown, error) { | |
), | ||
) | ||
|
||
sentry.ConfigureScope(func(scope *sentry.Scope) { | ||
scope.SetUser(sentry.User{ID: userId}) | ||
}) | ||
|
||
tracerProvider := sdktrace.NewTracerProvider( | ||
sdktrace.WithSpanProcessor(sentryotel.NewSentrySpanProcessor()), | ||
sdktrace.WithResource(r), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters