apisec

package
v2.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2025 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sampler

type Sampler interface {
	DecisionFor(SamplingKey) bool
}

func NewProxySampler

func NewProxySampler(rate int, interval time.Duration) Sampler

NewProxySampler creates a new sampler suitable for proxy environments where the sampling decision is not based on the request's properties, but on a rate.

func NewSampler

func NewSampler(interval time.Duration) Sampler

NewSampler returns a new *Sampler with the specified interval.

type SamplingKey

type SamplingKey struct {
	// Method is the value of the http.method span tag
	Method string
	// Route is the value of the http.route span tag
	Route string
	// StatusCode is the value of the http.status_code span tag
	StatusCode int
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL