getsentry / getsentry/sentry-go
Set mechanism type to origin
- Dominant language
- Go
- Stars
- 1.1k
- Forks
- 262
- Avg merge
- 1d 48m
- Merged PRs (30d)
- 7
Description
The SDK has two issues exception mechanisms:
- mechanism type is always `generic`. According to the [spec](https://develop.sentry.dev/sdk/telemetry/errors/#exception-mechanism), type must be non-generic for SDK captures, but we currently don't have a way to distinguish between the two.
- No real API to pass mechanism to the exception.
## Proposed Solution
Add a functional option `ExceptionOption` to `CaptureException`, `Recover`, and `RecoverWithContext` on both Hub and Client, so that we can inject `WithMechanism`:
```go
hub.CaptureException(err, sentry.WithMechanism(&sentry.Mechanism{
Type: "auto.http.go.gin.middleware",
Handled: false,
}))
```
Contributor guide
Assessment
This issue has not been assessed yet.