-
Notifications
You must be signed in to change notification settings - Fork 52
/
config.go
52 lines (40 loc) · 1.74 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package zapsentry
import (
"time"
"github.com/getsentry/sentry-go"
"go.uber.org/zap/zapcore"
)
// Configuration is a minimal set of parameters for Sentry integration.
type Configuration struct {
// Tags are passed as is to the corresponding sentry.Event field.
Tags map[string]string
// LoggerNameKey is the key for zap logger name.
// If not empty, the name is added to the rest of zapcore.Field(s),
// so that be careful with key duplicates.
// Leave LoggerNameKey empty to disable the feature.
LoggerNameKey string
// DisableStacktrace disables adding stacktrace to sentry.Event, if set.
DisableStacktrace bool
// Level is the minimal level of sentry.Event(s).
Level zapcore.LevelEnabler
// EnableBreadcrumbs enables use of sentry.Breadcrumb(s).
// This feature works only when you explicitly passed new scope.
EnableBreadcrumbs bool
// BreadcrumbLevel is the minimal level of sentry.Breadcrumb(s).
// Breadcrumb specifies an application event that occurred before a Sentry event.
// NewCore fails if BreadcrumbLevel is greater than Level.
// The field is ignored, if EnableBreadcrumbs is not set.
BreadcrumbLevel zapcore.LevelEnabler
// MaxBreadcrumbs is the maximum number of breadcrumb events to keep.
// Leave it zero or set to negative for a reasonable default value.
// The field is ignored, if EnableBreadcrumbs is not set.
MaxBreadcrumbs int
// FlushTimeout is the timeout for flushing events to Sentry.
FlushTimeout time.Duration
// Hub overrides the sentry.CurrentHub value.
// See sentry.Hub docs for more detail.
Hub *sentry.Hub
// FrameMatcher allows to ignore some frames of the stack trace.
// this is particularly useful when you want to ignore for instances frames from convenience wrappers
FrameMatcher FrameMatcher
}