Skip to content

Commit

Permalink
Add "app" and "run" labels to prometheus targets
Browse files Browse the repository at this point in the history
This makes it possible to filter metrics per service, for example

up{run=~"zuul.*"}

Change-Id: I37f0b915635276badd3fcaee48d63946678e29dd
  • Loading branch information
mhuin authored and morucci committed Dec 20, 2023
1 parent ee0d50e commit b170617
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions controllers/libs/monitoring/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ func MkPodMonitor(name string, ns string, ports []string, selector metav1.LabelS
Spec: monitoringv1.PodMonitorSpec{
Selector: selector,
PodMetricsEndpoints: endpoints,
PodTargetLabels: []string{"app", "run"},
},
}
}
Expand Down

0 comments on commit b170617

Please sign in to comment.