sentry

package module
v0.0.0-...-467ce3e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultFlushDuration = time.Second * 2

Variables

This section is empty.

Functions

func Flush

func Flush(timeout time.Duration) bool

Flush execute sentry.Flush

By default, the timeout is 2 seconds

func InitSentryForZap

func InitSentryForZap(cfg Config, opts ...Option) (zap.Option, error)

InitSentryForZap init sentry for zap logger

Types

type Config

type Config struct {
	Enabled          bool    `default:"false"`
	DSN              string  `env:"DSN" yaml:"dsn" usage:"The DSN to use. If the DSN is not set, the client is effectively disabled."`
	Environment      string  `usage:"The environment to be sent with events."`
	TracesSampleRate float64 `yaml:"traces_sample_rate" default:"1"`
	AttachStacktrace bool    `yaml:"attach_stacktrace" default:"true"`
	// contains filtered or unexported fields
}

func (*Config) Validate

func (c *Config) Validate() error

type Option

type Option func(*Config)

func WithAppVersion

func WithAppVersion(appVersion string) Option

func WithSentryConfig

func WithSentryConfig(v sentry.ClientOptions) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL