influxdata / influxdata/telegraf
[input.promethues] Pod IP will change after the host is shut down and restarted
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
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.
Contributor guide
Research direction
Start in plugins/inputs/prometheus/kubernetes.go around line 201 and trace how pod update events calculate the key and registered IP. Verify the behavior across a host shutdown and restart, then ensure the registered IP is refreshed when the pod IP changes while its name remains the same. Check the plugin's existing tests, if present, for the relevant update path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes, prometheus
- Domain
- devops, observability-sre
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100