forked from TheZeroSlave/zapsentry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
44 lines (34 loc) · 1.38 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
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.Level
// 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.Level
// 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
DynamicTags []string // tags from zap field names
}