mirror of https://github.com/prometheus/prometheus
Include Pod UID in the discovery metadata.
parent
303efee1a9
commit
06dc1e8797
|
@ -140,6 +140,7 @@ const (
|
||||||
podAnnotationPrefix = metaLabelPrefix + "pod_annotation_"
|
podAnnotationPrefix = metaLabelPrefix + "pod_annotation_"
|
||||||
podNodeNameLabel = metaLabelPrefix + "pod_node_name"
|
podNodeNameLabel = metaLabelPrefix + "pod_node_name"
|
||||||
podHostIPLabel = metaLabelPrefix + "pod_host_ip"
|
podHostIPLabel = metaLabelPrefix + "pod_host_ip"
|
||||||
|
podUID = metaLabelPrefix + "pod_uid"
|
||||||
)
|
)
|
||||||
|
|
||||||
func podLabels(pod *apiv1.Pod) model.LabelSet {
|
func podLabels(pod *apiv1.Pod) model.LabelSet {
|
||||||
|
@ -149,6 +150,7 @@ func podLabels(pod *apiv1.Pod) model.LabelSet {
|
||||||
podReadyLabel: podReady(pod),
|
podReadyLabel: podReady(pod),
|
||||||
podNodeNameLabel: lv(pod.Spec.NodeName),
|
podNodeNameLabel: lv(pod.Spec.NodeName),
|
||||||
podHostIPLabel: lv(pod.Status.HostIP),
|
podHostIPLabel: lv(pod.Status.HostIP),
|
||||||
|
podUID: lv(string(pod.ObjectMeta.UID)),
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v := range pod.Labels {
|
for k, v := range pod.Labels {
|
||||||
|
|
Loading…
Reference in New Issue