mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-28 04:49:58 +00:00
TUN-6724: Migrate to sentry-go from raven-go
This commit is contained in:
19
vendor/github.com/getsentry/sentry-go/traces_sampler.go
generated
vendored
Normal file
19
vendor/github.com/getsentry/sentry-go/traces_sampler.go
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package sentry
|
||||
|
||||
// A SamplingContext is passed to a TracesSampler to determine a sampling
|
||||
// decision.
|
||||
//
|
||||
// TODO(tracing): possibly expand SamplingContext to include custom /
|
||||
// user-provided data.
|
||||
type SamplingContext struct {
|
||||
Span *Span // The current span, always non-nil.
|
||||
Parent *Span // The parent span, may be nil.
|
||||
}
|
||||
|
||||
// The TracesSample type is an adapter to allow the use of ordinary
|
||||
// functions as a TracesSampler.
|
||||
type TracesSampler func(ctx SamplingContext) float64
|
||||
|
||||
func (f TracesSampler) Sample(ctx SamplingContext) float64 {
|
||||
return f(ctx)
|
||||
}
|
Reference in New Issue
Block a user