telemetry

package
v0.0.0-...-9a5365e Latest Latest
Warning

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

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

Documentation

Overview

Package telemetry is a utility package that provides helper methods for creating and registering metrics for kubernetes workqueue.

It can be used to create a new [MetricsProvider] object which can be used as a provider for a workqueue.

You should not create multiple metrics providers and register them for the same workqueue. It is recommended to create a global provider using the NewQueueMetricsProvider function and use it when creating the workqueue.

Example:

// global variable
queueMetricsProvider = workqueuetelemetry.NewQueueMetricsProvider()

// initialise workqueue with the metrics provider
wq := workqueue.NewRateLimitingQueueWithConfig(
		workqueue.NewItemExponentialFailureRateLimiter(
			time.Duration(2*time.Second),
			time.Duration(2*time.Minute),
		),
		workqueue.RateLimitingQueueConfig{
			Name:            "subsystem",
			MetricsProvider: queueMetricsProvider,
		},
	)

[MetricsProvdier] https://pkg.go.dev/k8s.io/client-go/util/workqueue#MetricsProvider workqueue https://pkg.go.dev/k8s.io/client-go/util/workqueue

Package telemetry provides implementation for the workqueue metrics provider

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueueMetricsProvider

type QueueMetricsProvider struct {
	// contains filtered or unexported fields
}

QueueMetricsProvider is a workqueue.MetricsProvider that provides metrics for workqueues

func NewQueueMetricsProvider

func NewQueueMetricsProvider() *QueueMetricsProvider

NewQueueMetricsProvider returns a new Queue Metrics Provider It is recommended to use this function to create a provider as a global variable and use it in your package and tests. This allows avoiding duplicate metrics registration.

func (*QueueMetricsProvider) NewAddsMetric

func (q *QueueMetricsProvider) NewAddsMetric(subsystem string) workqueue.CounterMetric

NewAddsMetric creates a new adds metric

func (*QueueMetricsProvider) NewDepthMetric

func (q *QueueMetricsProvider) NewDepthMetric(subsystem string) workqueue.GaugeMetric

NewDepthMetric creates a new depth metric

func (*QueueMetricsProvider) NewLatencyMetric

func (q *QueueMetricsProvider) NewLatencyMetric(subsystem string) workqueue.HistogramMetric

NewLatencyMetric creates a new latency metric

func (*QueueMetricsProvider) NewLongestRunningProcessorSecondsMetric

func (q *QueueMetricsProvider) NewLongestRunningProcessorSecondsMetric(subsystem string) workqueue.SettableGaugeMetric

NewLongestRunningProcessorSecondsMetric creates a new longest running processor seconds metric

func (*QueueMetricsProvider) NewRetriesMetric

func (q *QueueMetricsProvider) NewRetriesMetric(subsystem string) workqueue.CounterMetric

NewRetriesMetric creates a new retries metric

func (*QueueMetricsProvider) NewUnfinishedWorkSecondsMetric

func (q *QueueMetricsProvider) NewUnfinishedWorkSecondsMetric(subsystem string) workqueue.SettableGaugeMetric

NewUnfinishedWorkSecondsMetric creates a new unfinished work seconds metric

func (*QueueMetricsProvider) NewWorkDurationMetric

func (q *QueueMetricsProvider) NewWorkDurationMetric(subsystem string) workqueue.HistogramMetric

NewWorkDurationMetric creates a new work duration metric

Jump to

Keyboard shortcuts

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