metrics

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusSuccess is the string value for the status key indicating success
	StatusSuccess = "success"
	// StatusError is the string value for the status key indicating failure/errors
	StatusError = "error"
)

Variables

View Source
var (
	APICallDuration = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Help:      "Distribution of durations of API server calls",
			Namespace: configmanagement.MetricsNamespace,
			Subsystem: "syncer",
			Name:      "api_duration_seconds",
			Buckets:   []float64{.001, .01, .1, 1},
		},

		[]string{"operation", "status"},
	)
	ControllerRestarts = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Help:      "Total restart count for the NamespaceConfig and ClusterConfig controllers",
			Namespace: configmanagement.MetricsNamespace,
			Subsystem: "syncer",
			Name:      "controller_restarts_total",
		},

		[]string{"source"},
	)
	Operations = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Help:      "Total operations that have been performed to sync resources to source of truth",
			Namespace: configmanagement.MetricsNamespace,
			Subsystem: "syncer",
			Name:      "operations_total",
		},

		[]string{"operation", "status"},
	)
	ReconcileDuration = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Help:      "Distribution of syncer reconciliation durations",
			Namespace: configmanagement.MetricsNamespace,
			Subsystem: "syncer",
			Name:      "reconcile_duration_seconds",
			Buckets:   []float64{.001, .01, .1, 1, 10, 100},
		},

		[]string{"status"},
	)
	ReconcileEventTimes = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Help:      "Timestamps when syncer reconcile events occurred",
			Namespace: configmanagement.MetricsNamespace,
			Subsystem: "syncer",
			Name:      "reconcile_event_timestamps",
		},
		[]string{},
	)
)

Prometheus metrics

Functions

func StatusLabel

func StatusLabel(err error) string

StatusLabel returns a string representation of the given error appropriate for the status label of a Prometheus metric.

Types

This section is empty.

Jump to

Keyboard shortcuts

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