Documentation ¶
Index ¶
- Variables
- type EventHintCallback
- type Writer
- type WriterOption
- func WithAttachStacktrace() WriterOption
- func WithBeforeSend(beforeSend sentry.EventProcessor) WriterOption
- func WithBreadcrumbs() WriterOption
- func WithCaCerts(caCerts *x509.CertPool) WriterOption
- func WithDebug() WriterOption
- func WithDebugWriter(w io.Writer) WriterOption
- func WithEnvironment(environment string) WriterOption
- func WithHttpClient(httpClient *http.Client) WriterOption
- func WithHttpProxy(proxy string) WriterOption
- func WithHttpsProxy(proxy string) WriterOption
- func WithIgnoreErrors(reList []string) WriterOption
- func WithLevels(levels ...zerolog.Level) WriterOption
- func WithMaxErrorDepth(maxErrorDepth int) WriterOption
- func WithRelease(release string) WriterOption
- func WithSampleRate(rate float64) WriterOption
- func WithServerName(serverName string) WriterOption
- func WithTracing() WriterOption
- func WithTracingSampleRate(tsr float64) WriterOption
Constants ¶
This section is empty.
Variables ¶
var ErrFlushTimeout = errors.New("zlogsentry flush timeout")
Functions ¶
This section is empty.
Types ¶
type EventHintCallback ¶ added in v1.4.0
type EventHintCallback func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is a sentry events writer with std io.Writer iface.
func New ¶
func New(dsn string, opts ...WriterOption) (*Writer, error)
New creates writer with provided DSN and options.
func NewWithHub ¶ added in v1.7.0
func NewWithHub(hub *sentry.Hub, opts ...WriterOption) (*Writer, error)
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.
type WriterOption ¶
type WriterOption interface {
// contains filtered or unexported methods
}
WriterOption configures sentry events writer.
func WithAttachStacktrace ¶ added in v1.8.5
func WithAttachStacktrace() WriterOption
WithAttachStacktrace enabled AttachStacktrace.
func WithBeforeSend ¶ added in v1.4.0
func WithBeforeSend(beforeSend sentry.EventProcessor) WriterOption
WithBeforeSend sets a callback which is called before event is sent.
func WithBreadcrumbs ¶ added in v1.8.0
func WithBreadcrumbs() WriterOption
WithBreadcrumbs enables sentry client breadcrumbs.
func WithCaCerts ¶ added in v1.4.0
func WithCaCerts(caCerts *x509.CertPool) WriterOption
WithCaCerts enables sentry client tracing.
func WithDebugWriter ¶ added in v1.4.0
func WithDebugWriter(w io.Writer) WriterOption
WithDebugWriter enables sentry client tracing.
func WithEnvironment ¶
func WithEnvironment(environment string) WriterOption
WithEnvironment configures the environment to be sent with events.
func WithHttpClient ¶ added in v1.6.0
func WithHttpClient(httpClient *http.Client) WriterOption
WithHttpClient sets custom http client.
func WithHttpProxy ¶ added in v1.4.0
func WithHttpProxy(proxy string) WriterOption
WithHttpProxy enables sentry client tracing.
func WithHttpsProxy ¶ added in v1.4.0
func WithHttpsProxy(proxy string) WriterOption
WithHttpsProxy enables sentry client tracing.
func WithIgnoreErrors ¶ added in v1.0.0
func WithIgnoreErrors(reList []string) WriterOption
WithIgnoreErrors configures the list of regexp strings that will be used to match against event's message and if applicable, caught errors type and value. If the match is found, then a whole event will be dropped.
func WithLevels ¶
func WithLevels(levels ...zerolog.Level) WriterOption
WithLevels configures zerolog levels that have to be sent to Sentry. Default levels are: error, fatal, panic.
func WithMaxErrorDepth ¶ added in v1.6.0
func WithMaxErrorDepth(maxErrorDepth int) WriterOption
WithMaxErrorDepth sets the max depth of error chain.
func WithRelease ¶
func WithRelease(release string) WriterOption
WithRelease configures the release to be sent with events.
func WithSampleRate ¶
func WithSampleRate(rate float64) WriterOption
WithSampleRate configures the sample rate as a percentage of events to be sent in the range of 0.0 to 1.0.
func WithServerName ¶
func WithServerName(serverName string) WriterOption
WithServerName configures the server name field for events. Default value is OS hostname.
func WithTracing ¶ added in v1.4.0
func WithTracing() WriterOption
WithTracing enables sentry client tracing.
func WithTracingSampleRate ¶ added in v1.4.0
func WithTracingSampleRate(tsr float64) WriterOption
WithTracingSampleRate sets tracing sample rate.