sentry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: BSD-3-Clause 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, usually called before shutting down servers

func Init

func Init(conf Config) (err error)

Initialize the Sentry SDK with the configuration; must be called before 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 Sentry scope.

Types

type Config

type Config struct {
	DSN              string  `split_words:"true"`
	ServerName       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:"0.2"`
	Debug            bool    `default:"false"`
}

Sentry configuration for use in application-configuration

func (Config) ClientOptions

func (c Config) ClientOptions() sentry.ClientOptions

func (Config) GetRelease

func (c Config) GetRelease() string

func (Config) UsePerformanceTracking

func (c Config) UsePerformanceTracking() bool

Performance tracking is enabled if Sentry is enabled and track performance is explicitly set

func (Config) UseSentry

func (c Config) UseSentry() bool

Returns true if Sentry is enabled (e.g. a DSN is configured)

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