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 given configuration. This should be called before any servers are started.
func StreamInterceptor ¶ added in v1.7.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 v1.7.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"`
Environment string `split_words:"true"`
Release string `split_words:"true"`
TrackPerformance bool `split_words:"true" default:"false"`
SampleRate float64 `split_words:"true" default:"0.85"`
ReportErrors bool `split_words:"true" default:"false"`
Repanic bool `ignored:"true"`
Debug bool `default:"false"`
}
Sentry configuration
func (Config) GetRelease ¶
Get the configured version string or the current semantic version if not configured.
func (Config) UsePerformanceTracking ¶
Returns True if performance tracking is enabled.