prometheus

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 6 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Registerer is a prometheus registerer, e.g: prometheus.Registry.
	// By default will use Prometheus default registry.
	Registerer prometheus.Registerer
	// InQueueBuckets sets custom buckets for the duration/latency items in queue metrics.
	// Check https://godoc.org/github.com/prometheus/client_golang/prometheus#pkg-variables
	InQueueBuckets []float64
	// ProcessingBuckets sets custom buckets for the duration/latency processing metrics.
	// Check https://godoc.org/github.com/prometheus/client_golang/prometheus#pkg-variables
	ProcessingBuckets []float64
}

Config is the Recorder Config.

type Recorder

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

Recorder implements the metrics recording in a prometheus registry.

func New

func New(cfg Config) *Recorder

New returns a new Prometheus implementaiton for a metrics recorder.

func (Recorder) IncResourceEventQueued

func (r Recorder) IncResourceEventQueued(ctx context.Context, controller string, isRequeue bool)

IncResourceEventQueued satisfies controller.MetricsRecorder interface.

func (Recorder) ObserveResourceInQueueDuration

func (r Recorder) ObserveResourceInQueueDuration(ctx context.Context, controller string, queuedAt time.Time)

ObserveResourceInQueueDuration satisfies controller.MetricsRecorder interface.

func (Recorder) ObserveResourceProcessingDuration

func (r Recorder) ObserveResourceProcessingDuration(ctx context.Context, controller string, success bool, startProcessingAt time.Time)

ObserveResourceProcessingDuration satisfies controller.MetricsRecorder interface.

func (Recorder) RegisterResourceQueueLengthFunc

func (r Recorder) RegisterResourceQueueLengthFunc(controller string, f func(context.Context) int) error

RegisterResourceQueueLengthFunc satisfies controller.MetricsRecorder interface.

Jump to

Keyboard shortcuts

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