Documentation
¶
Index ¶
- Variables
- func DefaultFingerprintErrorHandler(err error)
- func Fingerprint500(err error, fingerprint []string) ([]string, error)
- func HubCustomFingerprint(hub *sentry.Hub, fingerprintOpts FingerprintOpts) *sentry.Hub
- func NormalizeUrlPathForSentry(url *url.URL, placeholder string) string
- func RedactDSN(body []byte) []byte
- func SentryBeforeSendUnwrapAndFilterErrorType(conf UnwrapAndFilterErrorTypeConfig) func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event
- func SlogErrHandler(ctx context.Context, err ErrSentryRoundTrip)
- type ErrSentryRoundTrip
- type Fingerprint
- type FingerprintOpts
- type LogSentrySendFailures
- type SentryError500
- type UnwrapAndFilterErrorTypeConfig
Constants ¶
This section is empty.
Variables ¶
var DefaultFingerprinter = FingerprintOpts{ ErrHandler: DefaultFingerprintErrorHandler, Fingerprinters: []Fingerprint{Fingerprint500}, }
Functions ¶
func DefaultFingerprintErrorHandler ¶
func DefaultFingerprintErrorHandler(err error)
func Fingerprint500 ¶
group on the url and the beginning of the body. The same url can have different errors: thus looking at the response body. the longer the body is, the more likely it is to contain variable So for now try looking at a beginning snippet of the body. The URL is normalized so that any path part with a number is replaced by a placeholder value
func HubCustomFingerprint ¶
func HubCustomFingerprint(hub *sentry.Hub, fingerprintOpts FingerprintOpts) *sentry.Hub
func NormalizeUrlPathForSentry ¶
NormalizeUrlPathForSentry takes a url path string and replaces any path part that contains a number with a standard placeholder value. This allows for better error grouping at Sentry for urls that may contain dynamic values (UUID for example) but are basically the same URL in general
func SentryBeforeSendUnwrapAndFilterErrorType ¶
func SentryBeforeSendUnwrapAndFilterErrorType(conf UnwrapAndFilterErrorTypeConfig) func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event
Golang error types tend to be generic wrappers Unwrap known generic error types until we find an unrecognized error type That error type is assumed to be useful Otherwise just strip the "*errors." or "errors." prefix which adds noise
func SlogErrHandler ¶
func SlogErrHandler(ctx context.Context, err ErrSentryRoundTrip)
Types ¶
type ErrSentryRoundTrip ¶
type ErrSentryRoundTrip struct {
Msg string
Err error
Status int
Request []byte
Exception []sentry.Exception
Response []byte
}
func (ErrSentryRoundTrip) Error ¶
func (esrt ErrSentryRoundTrip) Error() string
type FingerprintOpts ¶
type FingerprintOpts struct {
ErrHandler func(err error)
Fingerprinters []Fingerprint
}
type LogSentrySendFailures ¶
type LogSentrySendFailures struct {
RT http.RoundTripper
ErrorHandler func(context.Context, ErrSentryRoundTrip)
}
func NewLogSentrySendFailures ¶
func NewLogSentrySendFailures(rt http.RoundTripper) LogSentrySendFailures
type SentryError500 ¶
func (SentryError500) Error ¶
func (e500 SentryError500) Error() string
func (SentryError500) Fingerprint ¶
func (e500 SentryError500) Fingerprint(_ []string) ([]string, error)
type UnwrapAndFilterErrorTypeConfig ¶
type UnwrapAndFilterErrorTypeConfig struct {
FilterErrorTypes []string
}