clsentry

package
v0.35.4 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package clsentry provides Sentry error reporting.

Index

Constants

This section is empty.

Variables

View Source
var ErrFlushFailed = errors.New("failed to flush sentry hub")

ErrFlushFailed is returned when the flush fails during fx shutdown.

Functions

func Provide

func Provide() fx.Option

Provide configures the DI for providng rpc.

func StringFromEventID added in v0.32.9

func StringFromEventID(id *sentry.EventID) *string

StringFromEventID converts a sentry event ID to a string pointer.

func TestProvide added in v0.32.8

func TestProvide() fx.Option

TestProvide provides dependencies in a way that makes testing Sentry integration easier.

Types

type BeforeSendFunc added in v0.32.5

type BeforeSendFunc func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event

BeforeSendFunc allows events to be modified before they are sent to Sentry.

type Config

type Config struct {
	// Sentry DSN to send data to.
	DSN string `env:"DSN"`
	// TracesSampleRate is the rate at which traces are captures for Sentry.
	TracesSampleRate float64 `env:"TRACES_SAMPLE_RATE" envDefault:"1.0"`
	// DefaultFlushTimeout is the default timeout for flushing to Sentry.
	DefaultFlushTimeout time.Duration `env:"DEFAULT_FLUSH_TIMEOUT" envDefault:"2s"`
	// AttachStacktrace is whether to attach stacktrace to pure capture message calls.
	AttachStacktrace bool `env:"ATTACH_STACKTRACE" envDefault:"true"`
	// If set, will add this environment to the Sentry scope.
	Environment string `env:"ENVIRONMENT" envDefault:"development"`
}

Config configures.

type ObservedEvents added in v0.32.8

type ObservedEvents struct {
	// contains filtered or unexported fields
}

ObservedEvents keeps observe logs.

func (*ObservedEvents) Events added in v0.32.8

func (o *ObservedEvents) Events() (evs []sentry.Event)

Events returns a copy of all the ovserved events. It is safe to call from multiple goroutines.

Jump to

Keyboard shortcuts

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