metrics

package
v0.0.0-...-36b96fa Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2025 License: Apache-2.0 Imports: 7 Imported by: 38

Documentation

Index

Constants

View Source
const (
	Namespace   = "operator"
	LabelGroup  = "group"
	LabelKind   = "kind"
	LabelType   = "type"
	LabelReason = "reason"
)

Variables

This section is empty.

Functions

func RegisterClientMetrics

func RegisterClientMetrics(r prometheus.Registerer)

RegisterClientMetrics sets up the client latency and result metrics from client-go.

Types

type CounterMetric

type CounterMetric interface {
	Add(v float64, labels map[string]string)
	Inc(labels map[string]string)
	Delete(labels map[string]string)
	DeletePartialMatch(labels map[string]string)
	Reset()
}

func NewMultiCounter

func NewMultiCounter(counters ...CounterMetric) CounterMetric

func NewPrometheusCounter

func NewPrometheusCounter(registry prometheus.Registerer, opts prometheus.CounterOpts, labelNames []string) CounterMetric

type GaugeMetric

type GaugeMetric interface {
	Set(v float64, labels map[string]string)
	Delete(labels map[string]string)
	DeletePartialMatch(labels map[string]string)
	Reset()
}

func NewMultiGauge

func NewMultiGauge(gauges ...GaugeMetric) GaugeMetric

func NewPrometheusGauge

func NewPrometheusGauge(registry prometheus.Registerer, opts prometheus.GaugeOpts, labelNames []string) GaugeMetric

type LatencyAdapter

type LatencyAdapter struct {
	Metric ObservationMetric
}

LatencyAdapter implements LatencyMetric.

func (*LatencyAdapter) Observe

func (l *LatencyAdapter) Observe(_ context.Context, verb string, u url.URL, latency time.Duration)

Observe increments the request latency metric for the given verb/group/version/kind/subresource.

type MultiCounter

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

func (*MultiCounter) Add

func (mc *MultiCounter) Add(v float64, labels map[string]string)

func (*MultiCounter) Delete

func (mc *MultiCounter) Delete(labels map[string]string)

func (*MultiCounter) DeletePartialMatch

func (mc *MultiCounter) DeletePartialMatch(labels map[string]string)

func (*MultiCounter) Inc

func (mc *MultiCounter) Inc(labels map[string]string)

func (*MultiCounter) Reset

func (mc *MultiCounter) Reset()

type MultiGauge

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

func (*MultiGauge) Delete

func (mg *MultiGauge) Delete(labels map[string]string)

func (*MultiGauge) DeletePartialMatch

func (mg *MultiGauge) DeletePartialMatch(labels map[string]string)

func (*MultiGauge) Reset

func (mg *MultiGauge) Reset()

func (*MultiGauge) Set

func (mg *MultiGauge) Set(v float64, labels map[string]string)

type MultiObservation

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

func (*MultiObservation) Delete

func (mo *MultiObservation) Delete(labels map[string]string)

func (*MultiObservation) DeletePartialMatch

func (mo *MultiObservation) DeletePartialMatch(labels map[string]string)

func (*MultiObservation) Observe

func (mo *MultiObservation) Observe(v float64, labels map[string]string)

func (*MultiObservation) Reset

func (mo *MultiObservation) Reset()

type ObservationMetric

type ObservationMetric interface {
	Observe(v float64, labels map[string]string)
	Delete(labels map[string]string)
	DeletePartialMatch(labels map[string]string)
	Reset()
}

func NewMultiObservation

func NewMultiObservation(observations ...ObservationMetric) ObservationMetric

func NewPrometheusHistogram

func NewPrometheusHistogram(registry prometheus.Registerer, opts prometheus.HistogramOpts, labelNames []string) ObservationMetric

func NewPrometheusSummary

func NewPrometheusSummary(registry prometheus.Registerer, opts prometheus.SummaryOpts, labelNames []string) ObservationMetric

type PrometheusCounter

type PrometheusCounter struct {
	*prometheus.CounterVec
}

func (*PrometheusCounter) Add

func (pc *PrometheusCounter) Add(v float64, labels map[string]string)

func (*PrometheusCounter) Delete

func (pc *PrometheusCounter) Delete(labels map[string]string)

func (*PrometheusCounter) DeletePartialMatch

func (pc *PrometheusCounter) DeletePartialMatch(labels map[string]string)

func (*PrometheusCounter) Inc

func (pc *PrometheusCounter) Inc(labels map[string]string)

func (*PrometheusCounter) Reset

func (pc *PrometheusCounter) Reset()

type PrometheusGauge

type PrometheusGauge struct {
	*prometheus.GaugeVec
}

func (*PrometheusGauge) Delete

func (pg *PrometheusGauge) Delete(labels map[string]string)

func (*PrometheusGauge) DeletePartialMatch

func (pg *PrometheusGauge) DeletePartialMatch(labels map[string]string)

func (*PrometheusGauge) Reset

func (pg *PrometheusGauge) Reset()

func (*PrometheusGauge) Set

func (pg *PrometheusGauge) Set(v float64, labels map[string]string)

type PrometheusHistogram

type PrometheusHistogram struct {
	*prometheus.HistogramVec
}

func (*PrometheusHistogram) Delete

func (ph *PrometheusHistogram) Delete(labels map[string]string)

func (*PrometheusHistogram) DeletePartialMatch

func (ph *PrometheusHistogram) DeletePartialMatch(labels map[string]string)

func (*PrometheusHistogram) Observe

func (ph *PrometheusHistogram) Observe(v float64, labels map[string]string)

func (*PrometheusHistogram) Reset

func (ph *PrometheusHistogram) Reset()

type PrometheusSummary

type PrometheusSummary struct {
	*prometheus.SummaryVec
}

func (*PrometheusSummary) Delete

func (ps *PrometheusSummary) Delete(labels map[string]string)

func (*PrometheusSummary) DeletePartialMatch

func (ps *PrometheusSummary) DeletePartialMatch(labels map[string]string)

func (*PrometheusSummary) Observe

func (ps *PrometheusSummary) Observe(v float64, labels map[string]string)

func (*PrometheusSummary) Reset

func (ps *PrometheusSummary) Reset()

type ResultAdapter

type ResultAdapter struct {
	Metric CounterMetric
}

func (*ResultAdapter) Increment

func (r *ResultAdapter) Increment(_ context.Context, code, method, _ string)

Jump to

Keyboard shortcuts

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