metrics

package
v1.26.7 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RateLimitLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: negControllerSubsystem,
			Name:      "rate_limit_delay_seconds",
			Help:      "Latency of the RateLimiter Accept Operation",

			Buckets: prometheus.ExponentialBuckets(0.5, 2, 14),
		},
		metricsLabels,
	)

	StrategyLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: negControllerSubsystem,
			Name:      "strategy_delay_seconds",
			Help:      "Latency of the strategyRateLimiter Accept Operation",

			Buckets: prometheus.ExponentialBuckets(0.5, 2, 14),
		},
		metricsLabels,
	)

	StrategyUsedDelay = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: negControllerSubsystem,
			Name:      "strategy_used_delay_seconds",
			Help:      "Delay in seconds used by the throttling strategy",

			Buckets: prometheus.ExponentialBuckets(0.1, 2, 14),
		},
		metricsLabels,
	)

	StrategyLockLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: negControllerSubsystem,
			Name:      "strategy_lock_delay_seconds",
			Help:      "Latency of the lock acquisition for the StrategyRateLimiter",

			Buckets: append(prometheus.ExponentialBuckets(1e-9, 10, 8), prometheus.ExponentialBuckets(0.1, 12, 14)...),
		},
		metricsLabels,
	)

	ErrorsCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Subsystem: negControllerSubsystem,
			Name:      "errors_counter",
			Help:      "Number of different errors in the rate limiter",
		},
		append(metricsLabels, "error_type"),
	)
)

Functions

func PublishErrorRateLimiterMetrics added in v1.24.0

func PublishErrorRateLimiterMetrics(key string, err error)

func PublishRateLimiterMetrics

func PublishRateLimiterMetrics(key string, start time.Time)

func PublishStrategyMetrics added in v1.24.0

func PublishStrategyMetrics(key string, usedDelay, lockLatency time.Duration)

func PublishStrategyRateLimiterLatencyMetrics added in v1.24.0

func PublishStrategyRateLimiterLatencyMetrics(key string, start time.Time)

func RegisterMetrics

func RegisterMetrics()

Types

This section is empty.

Jump to

Keyboard shortcuts

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