Kubernetes Pod Monitors & Re-Labeling
The Prometheus operator offers a simple method to scrape metrics from any Pod. However in many cases the Pod itself is not what you are monitoring but the Pod is used to expose metrics that relate to the Node. In such cases what the user cares about is the Node on which the Pod runs and not the Pod itself.
By default when using
PodMonitor all the time series data will have the
instance set to the Pod's name. Also the Pod or the Daemon set that the Pod was part of may be deleted, redeployed multiple times over the lifetime of the node. This means that the user will need to perform the mapping between the Pod and the Node on which it run.
However Prometheus allows the instance name (among other labels) to be relabeled in a very simple manner as shown below.