Support pod name as additional tag in Prometheus input plugin
#16.192 aberto em 14 de nov. de 2024
Métricas do repositório
- Stars
- (9.892 stars)
- Métricas de merge de PR
- (Mesclagem média 2d 12h) (136 fundiu PRs em 30d)
Description
Use Case
We deploy telegraf to scrape istio metrics in the prometheus format and forward them to our internal metric system. The Istio metrics come from multiple istio ingressgateway pods but Istio metrics do not have any existing tag to indicate which source pod they come from. In this case, our internal metric system would automatically aggregate metrics from different pods in a weird way so that the metric become basically unavailable.
I am aware that the Prometheus input plugin supports pod annotation and pod label as extra tag, but not pod name, which seems as useful as labels/annotations to me. Therefore I would like to suggest adding a configuration that injects pod name as an extra metric tag for the prometheus input plugin.
Expected behavior
Have a configuration for the prometheus input plugin called something like pod_name_tag, which takes a boolean value and defaults to false. If it is enabled, pod name is injected to all metrics collected by the prometheus input plugin, for example, source_pod_name: istio-ingressgateway-ase33.
Actual behavior
Pod name cannot be configured to be an extra tag on metrics collected by the prometheus plugin.
Additional info
I am glad to contribute if the community finds this feature request useful and would like to move forward with it. Thanks!