Skip to content

Set mechanism type to origin #1102

@giortzisg

Description

@giortzisg

The SDK has two issues exception mechanisms:

  • mechanism type is always generic. According to the spec, 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:

hub.CaptureException(err, sentry.WithMechanism(&sentry.Mechanism{
    Type:    "auto.http.go.gin.middleware",
    Handled: false,
}))

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions