Documentation
¶
Index ¶
Constants ¶
View Source
const ( // FieldRequest holds an *http.Request. FieldRequest = "request" // FieldUser holds a User or *User value. FieldUser = "user" // FieldTransaction holds a transaction ID as a string. FieldTransaction = "transaction" // FieldFingerprint holds a string slice ([]string), used to dictate the // grouping of this event. FieldFingerprint = "fingerprint" // These fields are simply omitted, as they are duplicated by the Sentry SDK. FieldGoVersion = "go_version" FieldMaxProcs = "go_maxprocs" )
These default log field keys are used to pass specific metadata in a way that Sentry understands. If they are found in the log fields, and the value is of the expected datatype, it will be converted from a generic field, into Sentry metadata.
Variables ¶
View Source
var ( // ErrFlushTimeout is returned when the flush operation times out. ErrFlushTimeout = errors.New("sentryzerolog flush timeout") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { sentry.ClientOptions Options }
type Options ¶
type Options struct { // Levels specifies the log levels that will trigger event sending to Sentry. // Only log messages at these levels will be sent. By default, the levels are // Error, Fatal, and Panic. Levels []zerolog.Level // WithBreadcrumbs, when enabled, adds log entries as breadcrumbs in Sentry. // Breadcrumbs provide a trail of events leading up to an error, which can // be invaluable for understanding the context of issues. WithBreadcrumbs bool // FlushTimeout sets the maximum duration allowed for flushing events to Sentry. // This is the time limit within which all pending events must be sent to Sentry // before the application exits. A typical use is ensuring all logs are sent before // application shutdown. The default timeout is usually 3 seconds. FlushTimeout time.Duration }
func (*Options) SetDefaults ¶
func (o *Options) SetDefaults()
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is a sentry events writer with std io.Writer interface.
func NewWithHub ¶
NewWithHub creates a writer using an existing sentry Hub and options.
func (*Writer) Close ¶
Close forces client to flush all pending events. Can be useful before application exits.
Click to show internal directories.
Click to hide internal directories.