sentry

package
v1.5.1-rc.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flush

func Flush(timeout time.Duration) bool

Flush the Sentry log, this is usually called before shutting down the servers.

func Init

func Init(conf Config) (err error)

Initialize the Sentry SDK with the given configuration. This should be called before any servers are started.

func TrackPerformance

func TrackPerformance(tags map[string]string) gin.HandlerFunc

Gin middleware that tracks HTTP request performance with Sentry.

func UseTags

func UseTags(tags map[string]string) gin.HandlerFunc

Gin middleware that adds request-level tags to the current Sentry scope. This also accepts a map of service-level tags to uniquely identify properties of the http service for monolithic server setups.

Types

type Config

type Config struct {
	DSN              string  `split_words:"true"`
	Environment      string  `split_words:"true"`
	Release          string  `split_words:"true"`
	TrackPerformance bool    `split_words:"true" default:"false"`
	SampleRate       float64 `split_words:"true" default:"1.0"`
	Debug            bool    `default:"false"`
}

Sentry configuration

func (Config) GetRelease

func (c Config) GetRelease() string

Get the configured version string or the current semantic version if not configured.

func (Config) UsePerformanceTracking

func (c Config) UsePerformanceTracking() bool

Returns True if performance tracking is enabled.

func (Config) UseSentry

func (c Config) UseSentry() bool

Returns True if Sentry is enabled.

func (Config) Validate

func (c Config) Validate() error

Jump to

Keyboard shortcuts

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