Hi,
On 6/26/20 10:33 AM, Björn Fischer wrote:
> I was going through the guide for file-based service discovery [1] and
> noticed that they are setting the job label in the targets file. That
> doesn't make sense to me. Targets are not strictly job-specific and
> Prometheus is setting the job label anyways. Can someone think of a
> reason to set the job label explicitly here?
Yes, Prometheus will set a job label anyway. I assume it was simple
chosen as an example for setting a label there without inventing a
non-default label.
While I think there are cases where overriding the job label makes sense
[1], I don't think it is too common.
So, I agree that this example is a bit confusing. Maybe a Pull Request
to improve this would be welcome?
Kind regards,
Christian
[1] For example, we want all node_exporter jobs to have the job="node"
label, but we have to make them multiple jobs because of different
proxy_url settings. Therefore, we have node-proxy1, but explicitly set
job="node" as a label.