Documentation ¶
Index ¶
- func AlwaysSample(ctx context.Context) context.Context
- func AlwaysSampleHeaderHandler(header string, value string, handler http.Handler) http.Handler
- func EnableOTELMetrics(ctx context.Context) func(context.Context) error
- func EnableOTELTracing(ctx context.Context) func(context.Context) error
- func ForceableSampler(wrapped sdktrace.Sampler) sdktrace.Sampler
- func NewHandler(handler http.Handler, filters ...ForceSampleFilter) http.Handler
- type ForceSampleFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlwaysSample ¶
AlwaysSample returns a context that will always be sampled by the sampler.
func AlwaysSampleHeaderHandler ¶
AlwaysSampleHeaderHandler wraps the passed handler and always samples requests that have the specified header set to the specified value.
func EnableOTELMetrics ¶
EnableOTELMetrics enables OTEL metrics, configuring the OTEL provider using environment variables.
func EnableOTELTracing ¶
Sample rates should be configured via environment variables. See https://opentelemetry-python.readthedocs.io/en/latest/sdk/trace.sampling.html For example: OTEL_TRACES_SAMPLER=traceidratio OTEL_TRACES_SAMPLER_ARG=0.001
func ForceableSampler ¶
ForceableSampler returns a Sampler that uses the sampler from the environment but that checks the parent context for a special key that overrides the sampler to always sample.
func NewHandler ¶
func NewHandler(handler http.Handler, filters ...ForceSampleFilter) http.Handler
NewHandler wraps the passed handler and allows callers to set rules for things that should always be sampled.
Types ¶
type ForceSampleFilter ¶
func AlwaysSampleHTTPHeader ¶
func AlwaysSampleHTTPHeader(header string, value string) ForceSampleFilter
AlwaysSampleHTTPHeader returns a ForceSampleFilter that will always sample requests that have the specified header set to the specified value. If the value is "*", then it will always sample requests that have the header set to any value.