Archived in favour of kube-state-metrics. After kubernetes/kube-state-metrics#1468 - its now able to export annotations as metrics again.
Exports pod and namespace annotations as metrics.
The namespace metrics are a substitute for old kube-state-metrics functionality:
kube_namespace_annotations
: includes labels fornamespace
,key
andvalue
kube_pod_annotations
: includes labels forpod
,namespace
,key
andvalue
By default, every annotation is exported for every pod and namespace. This
could produce a large number of series, so to mitigate this, you can provide a list
of annotations that you want to export with the flags -namespace-annotations
and -pod-annotations
.
For example:
./kube-annotations-exporter \
-pod-annotations="prometheus.io/scrape" \
-pod-annotations="prometheus.io/path" \
-pod-annotations="kubernetes.io/psp"
The flags can also be provided as a comma-delimited list:
./kube-annotations-exporter \
-pod-annotations="prometheus.io/scrape,prometheus.io/path,kubernetes.io/psp"