Commit Graph

3 Commits

Author SHA1 Message Date
Frederic Branczyk 834a0c0d06
volumeattachment: Fix instrumentation guideline violation 2020-04-08 10:55:33 +02:00
jangdm e2c2d6498c Title does not match content 2020-03-31 08:17:05 +00:00
Jens Erat 4e637854a2
add VolumeAttachment collector
Kubernetes has a new resource type: `VolumeAttachments`. They provide
helpful information on where a volume is attached and to alert on
unexpected attachment status (for example, differences between
information scraped from node-exporter and kube-state-metrics).

The collector adds a bunch of new metrics. Each VolumeAttachment (ie.,
each CSI-attached volume) will have one of each, so we do not overly
pollute the metrics space. Most metrics are rather unsurprising.

- `kube_volumeattachment_status_attachment_metadata`: provides a
  label-like export of the attachment metadata map. Generalizing the
  label-conversion function slightly helps at providing this metric.
- `kube_volumeattachment_created`: as VolumeAttachments are
  automatically created and we already suffered from duplicate
  `VolumeAttachments`, this can be invaluable for debugging
  misattachments.
- `kube_volumeattachment_spec_source_persistentvolume`: will only be
  generated when the volume source is of `PersistentVolume` type. The
  other type `inlineVolumeSpec` is still alpha-level and hard to map to
  metrics.

No end-to-end test manifest was added, as `VolumeAttachment`s are
automatically generated when mounting volumes.

Signed-off-by: Jens Erat <email@jenserat.de>
2019-10-13 21:36:50 +02:00