statemetrics

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kubernetes

type Kubernetes interface {
	prometheus.Metric
	prometheus.Collector

	// Set sets the tracked number to an arbitrary value.
	Set(float64)
}

Kubernetes is a metric tracking a numerical value that can arbitrary go up and down.

type KubernetesOpts

type KubernetesOpts prometheus.Opts

KubernetesOpts is an alias for Opts.

type KubernetesVec

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

KubernetesVec is a Collector that bundles a set of Kubernetes metrics that all share the same Desc, but have different values for their variable labels. This is used if you want to count the same thing partitioned by various dimensions (e.g., namespaces, types). Create instances with NewKubernetesVec.

func NewKubernetesVec

func NewKubernetesVec(opts KubernetesOpts, labelNames []string) *KubernetesVec

NewKubernetesVec creates a new KubernetesVec based on the provided KubernetesOpts and partitioned by the given label names.

func (*KubernetesVec) Collect

func (v *KubernetesVec) Collect(ch chan<- prometheus.Metric)

Collect implements Collector.

func (*KubernetesVec) Delete

func (v *KubernetesVec) Delete(uid types.UID)

Delete deletes the metric stored for this uid.

func (*KubernetesVec) Describe

func (v *KubernetesVec) Describe(ch chan<- *prometheus.Desc)

Describe implements Collector.

func (*KubernetesVec) WithLabelValues

func (v *KubernetesVec) WithLabelValues(uid types.UID, lvs ...string) Kubernetes

WithLabelValues returns the Kubernetes metric for the given slice of label values (in the same order as the variable labels).

Consecutive calls for the same uid replace earlier metrics.

type LabelsVec

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

LabelsVec is a Collector that bundles a set of unchecked Kubernetes metrics that all share the same Desc, but have different labels. This is used if you want to count the same thing partitioned by unbounded dimensions (e.g., Kubernetes labels). Create instances with NewLabelsVec.

func NewLabelsVec

func NewLabelsVec(opts KubernetesOpts) *LabelsVec

NewLabelsVec creates a new LabelsVec based on the provided KubernetesOpts.

func (*LabelsVec) Collect

func (v *LabelsVec) Collect(ch chan<- prometheus.Metric)

Collect implements Collector.

func (*LabelsVec) Delete

func (v *LabelsVec) Delete(uid types.UID)

Delete deletes the metric stored for this uid.

func (*LabelsVec) Describe

func (v *LabelsVec) Describe(chan<- *prometheus.Desc)

Describe implements Collector. No Desc are sent on the channel to make this an unchecked collector.

func (*LabelsVec) With

func (v *LabelsVec) With(uid types.UID, l prometheus.Labels) Kubernetes

With returns the Kubernetes metric for the given Labels map.

Consecutive calls with the same uid replace earlier metrics.

type StateMetricProxy

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

StateMetricProxy updates state metrics by intercepting events as they are passed to event handlers.

func NewStateMetricProxy

func NewStateMetricProxy(enqueuer handler.EventHandler, info, created, resourceVersion, lbType, peerKey *KubernetesVec, labels *LabelsVec) *StateMetricProxy

NewStateMetricProxy returns a StateMetricsProxy. All metrics must be non-nil.

func (*StateMetricProxy) Create

Create implements EventHandler.

func (*StateMetricProxy) Delete

Delete implements EventHandler.

func (*StateMetricProxy) Generic

Generic implements EventHandler.

func (*StateMetricProxy) Update

Update implements EventHandler.

Jump to

Keyboard shortcuts

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