Documentation
¶
Overview ¶
Package sentryutils reports Flyte operation counts and server-side failures to Sentry. The DSN is hardcoded and is not user configuration; DO_NOT_TRACK=1 opts out (FLYTE_DISABLE_TELEMETRY=true and the legacy FLYTE_DISABLE_SENTRY=true are honored too).
Index ¶
- func Count(ctx context.Context, operation string, n int64)
- func Disabled() bool
- func Flush()
- func Gauge(ctx context.Context, name string, value float64)
- func Init(ctx context.Context, environment string) bool
- func Interceptor(operations map[string]string) connect.UnaryInterceptorFunc
- func SampleGauges(ctx context.Context, interval time.Duration, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Flush ¶
func Flush()
Flush drains buffered events and metrics. Sentry sends async, so a service shutting down has to wait or lose whatever is still queued.
func Gauge ¶ added in v2.0.54
Gauge records the current value of the metric name. Unlike Count, each gauge is its own metric with no attributes. An empty name or a NaN or infinite value is dropped with a warning.
func Interceptor ¶
func Interceptor(operations map[string]string) connect.UnaryInterceptorFunc
Interceptor counts one operation per call for each procedure in operations (keyed by procedure, valued by operation name) and reports server-side failures as exceptions. Client-caused errors (invalid argument, not found, ...) are intentionally not reported as exceptions.
func SampleGauges ¶ added in v2.0.55
func SampleGauges(ctx context.Context, interval time.Duration, sample func(context.Context) (map[string]float64, error)) error
SampleGauges calls sample every interval and emits each value it returns as a gauge. Each call to sample must finish within interval. A failed sample is logged and nothing is emitted for that tick. SampleGauges returns nil when ctx is done.
Types ¶
This section is empty.