Documentation ¶
Index ¶
- Variables
- func NewSentryHubContext(ctx context.Context) context.Context
- func NewSentryHubGinContext(ctx context.Context) *gin.Context
- func RecoverAndRaise(ctx context.Context)
- func ReportError(ctx context.Context, err error, scopeFuncs ...func(*sentry.Scope))
- func ReportRemappedError(ctx context.Context, originalErr error, remappedErr interface{})
- func ScrubEventHeaders(event *sentry.Event, hint *sentry.EventHint) *sentry.Event
- func SentryHubFromContext(ctx context.Context) *sentry.Hub
- func SetErrorContext(scope *sentry.Scope, mapped bool, mappedTo string)
- func SpanFilterEventProcessor(ctx context.Context, maxSpans int, minSpanDuration time.Duration, ...) sentry.EventProcessor
- func TransactionNameSafe(name string) sentry.SpanOption
- func UpdateErrorFingerprints(event *sentry.Event, hint *sentry.EventHint) *sentry.Event
- func UpdateLogErrorEvent(event *sentry.Event, hint *sentry.EventHint) *sentry.Event
Constants ¶
This section is empty.
Variables ¶
var SentryLoggerHook = &sentryLoggerHook{crumbTrailLimit: sentryTrailLimit, reportLevels: logrus.AllLevels}
SentryLoggerHook forwards log entries to Sentry.
Functions ¶
func NewSentryHubContext ¶
NewSentryHubContext returns a copy of the parent context with an instance of its hub attached. If no hub exists, the default hub stored in the global namespace is used. This is useful for separating sentry-related data when starting new goroutines.
func NewSentryHubGinContext ¶
NewSentryHubGinContext returns a new Gin context with a cloned hub of the original context's hub. The hub is added to the context's request so that the sentrygin middleware is able to find it.
func RecoverAndRaise ¶
RecoverAndRaise reports the panic to Sentry then re-raises it.
func ReportError ¶
ReportError reports an error with optional scope functions to add additional context.
func ReportRemappedError ¶
ReportRemappedError reports an error with additional context indicating the original error and the remapped error.
func ScrubEventHeaders ¶
func ScrubEventHeaders(event *sentry.Event, hint *sentry.EventHint) *sentry.Event
func SentryHubFromContext ¶
SentryHubFromContext gets a Hub from the supplied context, or from an underlying gin.Context if one is available.
func SetErrorContext ¶
func SpanFilterEventProcessor ¶
func SpanFilterEventProcessor(ctx context.Context, maxSpans int, minSpanDuration time.Duration, maxFilterPasses int, alwaysFilter bool) sentry.EventProcessor
SpanFilterEventProcessor applies a progressive filter to spans, removing the shortest spans until the total span count is less than the specified maxSpans value. Initially, spans shorter than minSpanDuration will be dropped, but each filter pass (up to maxFilterPasses) will double the minSpanDuration until enough spans have been filtered out. If alwaysFilter is specified, spans shorter than minSpanDuration will be removed, even if the total span count is low enough not to require any filtering.
func TransactionNameSafe ¶
func TransactionNameSafe(name string) sentry.SpanOption
TransactionNameSafe sets the name for the current transaction if a name is not already set.
func UpdateErrorFingerprints ¶
func UpdateErrorFingerprints(event *sentry.Event, hint *sentry.EventHint) *sentry.Event
func UpdateLogErrorEvent ¶
func UpdateLogErrorEvent(event *sentry.Event, hint *sentry.EventHint) *sentry.Event
UpdateLogErrorEvent updates the outgoing event with data from the logged error.
Types ¶
This section is empty.