See https://www.robustperception.io/controlling-the-instance-label
- you can set the instance label separately from the __address__ that is
scraped
- job_name: 'apigeenode'
static_configs:
- targets:
- 10.2.0.85 <http://10.2.3.17:8080/10.2.0.85>
- 10.2.0.86 <http://10.2.3.17:8080/10.2.0.86>
- ...
relabel_configs:
- source_labels: [__address__]
target_label: instance
- source_labels: [__address__]
target_label: __param_target
replacement: http://10.2.3.17:8080/$1
- target_label: __address__
replacement: 10.2.3.17:8080
With the above, the instance label will be "10.2.0.85" for example.
I don't really understand why both the address and param_target are being
set to 10.2.3.17:8080. It looks like maybe you want to set __metric_path__
instead. But if it works, it works.
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/95a0f1a9-d95f-49e6-844a-370274b69557o%40googlegroups.com.