Documentation
¶
Overview ¶
Package sentry provides helpers for logging errors to sentry from sdk primitives like the logger.
Index ¶
- Constants
- Variables
- func AddListeners(log logger.Listenable, meta configmeta.Meta, cfg Config, ...) error
- func GetFingerprint(ctx context.Context) []string
- func WithFingerprint(ctx context.Context, fingerprint ...string) context.Context
- type AddListenersOption
- type AddListenersOptions
- type Client
- type Config
- type Sender
Constants ¶
const ( Platform = "go" SDK = "sentry.go" ListenerName = "sentry" )
Constants
Variables ¶
Functions ¶
func AddListeners ¶
func AddListeners(log logger.Listenable, meta configmeta.Meta, cfg Config, opts ...AddListenersOption) error
AddListeners adds error listeners.
func GetFingerprint ¶
GetFingerprint gets a context specific fingerprint from the context. You can set this with `WithFingerprint(...)`. It will override the default behavior of setting the fingerprint to the logger path + err.Error().
Types ¶
type AddListenersOption ¶ added in v1.20210402.2
type AddListenersOption func(options *AddListenersOptions)
AddListenersOption mutates AddListeners options
func AddListenersOptionFlags ¶ added in v1.20210402.2
func AddListenersOptionFlags(flags ...string) AddListenersOption
AddListenersOptionFlags sets the logger flags to send Sentry notifications for
func AddListenersOptionScopes ¶ added in v1.20210402.2
func AddListenersOptionScopes(scopes ...string) AddListenersOption
AddListenersOptionScopes sets the logger scopes to send Sentry notifications for
type AddListenersOptions ¶ added in v1.20210402.2
AddListenersOptions are all the options we can set when adding Sentry error listeners
type Config ¶
type Config struct {
// The DSN to use. If the DSN is not set, the client is effectively disabled.
DSN string `json:"dsn" yaml:"dsn"`
// The server name to be reported.
ServerName string `json:"serverName" yaml:"serverName"`
// The dist to be sent with events.
Dist string `json:"dist" yaml:"dist"`
// The release to be sent with events.
Release string `json:"release" yaml:"release"`
// The environment to be sent with events.
Environment string `json:"environment" yaml:"environment"`
// Maximum number of breadcrumbs.
MaxBreadcrumbs int `json:"maxBreadCrumbs" yaml:"maxBreadCrumbs"`
// Debug prints debugging information to the screen.
Debug bool `json:"debug" yaml:"debug"`
// FlushTimeout is the timeout for flushing exceptions to sentry.
FlushTimeout time.Duration `json:"flushTimeout" yaml:"flushTimeout"`
}
Config is the sentry config.
func (Config) FlushTimeoutOrDefault ¶ added in v1.20210428.4
FlushTimeoutOrDefault returns the flush timeout or a default.
func (*Config) GetDSNHost ¶ added in v1.20210103.1
GetDSNHost returns just the scheme and hostname for the dsn.