Usage Metrics Collector

The usage-metrics-collector is a Prometheus metrics collector optimized for collecting kube usage and capacity metrics.

Motivation

Why not just use promql and recording rules?

Example

collector.yaml

Architecture

considerations

metrics-node-sampler

metrics-prometheus-collector

collector side-cars

Exposed Metrics

A sample of the exposed metrics is available in METRICS.md.

In addition to these metrics, a series of performance related metrics are published for the collection process. These metrics are documented in performance analysis document.

Getting started

Note: No usage-metrics-collector container image is publicly hosted. Folks will need to build and publish this own until this is resolved.

Installing into a cluster

Kind cluster

Important: requires using cgroups v1.

  1. Create a kind cluster
  1. Build the image
  1. Load the image into kind
  1. Install the config
  1. Update your context to use the usage-metrics-collector namespace by default

Kicking the tires

  1. Make sure the pods are healthy
  1. Make sure the services have endpoints
  1. Get the metrics from the collector itself
  1. Get the metrics from prometheus
  1. View the metrics in Grafana

Specifying aggregation rules

  1. Edit config/metrics-prometheus-collector/configmaps/collector.yaml
  2. Run make run-local
  3. View the updated metrics in grafana

Code of conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.