Documentation ¶
Index ¶
- type Kubernetes
- type KubernetesOpts
- type KubernetesVec
- type LabelsVec
- type StateMetricProxy
- func (s *StateMetricProxy) Create(evt event.CreateEvent, q workqueue.RateLimitingInterface)
- func (s *StateMetricProxy) Delete(evt event.DeleteEvent, q workqueue.RateLimitingInterface)
- func (s *StateMetricProxy) Generic(evt event.GenericEvent, q workqueue.RateLimitingInterface)
- func (s *StateMetricProxy) Update(evt event.UpdateEvent, q workqueue.RateLimitingInterface)
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 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) 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 ¶
func (s *StateMetricProxy) Create(evt event.CreateEvent, q workqueue.RateLimitingInterface)
Create implements EventHandler.
func (*StateMetricProxy) Delete ¶
func (s *StateMetricProxy) Delete(evt event.DeleteEvent, q workqueue.RateLimitingInterface)
Delete implements EventHandler.
func (*StateMetricProxy) Generic ¶
func (s *StateMetricProxy) Generic(evt event.GenericEvent, q workqueue.RateLimitingInterface)
Generic implements EventHandler.
func (*StateMetricProxy) Update ¶
func (s *StateMetricProxy) Update(evt event.UpdateEvent, q workqueue.RateLimitingInterface)
Update implements EventHandler.