influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.57k stars 5.56k forks source link

[input.promethues] Pod IP will change after the host is shut down and restarted #16003

Open Tong97 opened 1 day ago

Tong97 commented 1 day ago

https://github.com/influxdata/telegraf/blob/4e6e2a297b3fbb6540ae9a5377f9f29bb20e6c41/plugins/inputs/prometheus/kubernetes.go#L201 Because the pod IP will change after the host is shut down and restarted, but the pod name will not change, which will cause the plug-in to always access the old IP, so this key cannot be used to determine whether to update the registered IP. Therefore, it is necessary to change the key value calculation or update the registered IP no matter what when there is an update event, because this does not affect anything.

srebhan commented 1 day ago

As you seem to know what needs to be done, would you care to put up a PR fixing this issue!?