Documentation
¶
Index ¶
- func Flush(timeout time.Duration) bool
- func Init(conf Config) (err error)
- func StreamInterceptor(conf Config) grpc.StreamServerInterceptor
- func TrackPerformance(tags map[string]string) gin.HandlerFunc
- func UnaryInterceptor(conf Config) grpc.UnaryServerInterceptor
- func UseTags(tags map[string]string) gin.HandlerFunc
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
Initialize the Sentry SDK with the configuration; must be called before servers are started
func StreamInterceptor ¶ added in v0.2.0
func StreamInterceptor(conf Config) grpc.StreamServerInterceptor
StreamInterceptor for gRPC services that are using Sentry. Ensures that Sentry is used in a thread-safe manner and that performance, panics, and errors are correctly tracked with gRPC method names. Streaming RPCs don't necessarily benefit from Sentry performance tracking, but it is helpful to see average durations.
func TrackPerformance ¶
func TrackPerformance(tags map[string]string) gin.HandlerFunc
Gin middleware that tracks HTTP request performance with Sentry
func UnaryInterceptor ¶ added in v0.2.0
func UnaryInterceptor(conf Config) grpc.UnaryServerInterceptor
UnaryInterceptor for gRPC services that are using Sentry. Ensures that Sentry is used in a thread-safe manner and that performance, panics, and errors are correctly tracked with gRPC method names.
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"`
ReportErrors bool `split_words:"true" default:"false"`
Repanic bool `ignored:"true"`
Debug bool `default:"false"`
}
Sentry configuration for use in application-configuration
func (Config) ClientOptions ¶
func (c Config) ClientOptions() sentry.ClientOptions
func (Config) GetRelease ¶
func (Config) UsePerformanceTracking ¶
Performance tracking is enabled if Sentry is enabled and track performance is explicitly set