sentry

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: BSD-3-Clause Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureException

func CaptureException(err error)

func Enabled

func Enabled() bool

func Recover

func Recover(err any)

Types

type ConfigOpts

type ConfigOpts struct {
	Enabled        bool              `json:"enabled" yaml:"enabled"`
	DSN            string            `json:"dsn" yaml:"dsn"`
	Debug          bool              `json:"debug" yaml:"debug"`
	Tags           map[string]string `json:"tags" yaml:"tags"`
	Release        string            `json:"release" yaml:"release"`
	Environment    string            `json:"environment" yaml:"environment"`
	TracingEnabled bool              `json:"tracing_enabled" yaml:"tracing_enabled"`
	SampleRate     float64           `json:"sample_rate" yaml:"sample_rate"`
}

ConfigOpts all map to environment variables. For example:

  • SENTRY_ENABLED=true -> ConfigOpts.Enabled=true
var Config *ConfigOpts

Config Global Singleton that can be accessed from anywhere in the app. This is required because panic recovery can happen anywhere in the app.

func InitSentryConfig

func InitSentryConfig() (*ConfigOpts, error)

InitSentryConfig from environment. Errors if called more than once.

Jump to

Keyboard shortcuts

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