watchermetrics

package
v1.4.0-pre.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WatcherErrors = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace:   consts.MetricsNamespace,
		Name:        "watcher_errors_total",
		Help:        "The total number of errors for a given watcher type.",
		ConstLabels: nil,
	}, []string{"watcher", "error"})
	WatcherEvents = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace:   consts.MetricsNamespace,
		Name:        "watcher_events_total",
		Help:        "The total number of events for a given watcher type.",
		ConstLabels: nil,
	}, []string{"watcher"})

	WatcherDeletedPodCacheHits = prometheus.NewCounter(prometheus.CounterOpts{
		Namespace:   consts.MetricsNamespace,
		Name:        "watcher_delete_pod_cache_hits",
		Help:        "The total hits for pod information in the deleted pod cache.",
		ConstLabels: nil,
	})
)

Functions

func GetWatcherDeletedPodCacheHits added in v1.2.1

func GetWatcherDeletedPodCacheHits() prometheus.Counter

func GetWatcherErrors

func GetWatcherErrors(watcherType Watcher, watcherError ErrorType) prometheus.Counter

Get a new handle on an WatcherEvents metric for a watcher type

func GetWatcherEvents

func GetWatcherEvents(watcherType Watcher) prometheus.Counter

Get a new handle on an WatcherEvents metric for a watcher type

func InitMetrics added in v0.11.0

func InitMetrics()

func RegisterMetrics added in v1.2.0

func RegisterMetrics(group metrics.Group)

Types

type ErrorType

type ErrorType string
const (
	FailedToGetPodError ErrorType = "failed_to_get_pod"
)

type Watcher added in v1.1.0

type Watcher int
const (
	K8sWatcher Watcher = iota
)

TODO: Having only one watcher type, "k8s", makes it not a useful label. Maybe "pod" would be more informative.

func (Watcher) String added in v1.1.0

func (w Watcher) String() string

Jump to

Keyboard shortcuts

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