tried this way it's working fine please suggest if there is any
alternative way
- job_name: postgres_exporter_lr-1m0s
scrape_interval: 10s
scrape_timeout: 10s
metrics_path: /metrics
static_configs:
- targets:
- x.x.x.x:9187
labels:
agent_type: postgres_exporter
node_name: ip-x.x.x.x
node_type: generic
region: eastus1
service_type: postgresql
service_name: ip-x.x.x.x
- targets:
- y.y.y.y:9187
labels:
agent_type: postgres_exporter
node_name: ip-y.y.y.y
node_type: generic
region: eastus1
service_type: postgresql
service_name: ip-y.y.y.y
On Saturday, 18 April 2020 16:19:58 UTC+5:30, vinay jaiswal wrote:
>
> Hi ,
>
> Can anyone help me to define labels on the basis of targets in a single
> job name so that receptive targets can pick the label name accordingly in
> prometheus config . i don't want to define multiple job name for labels
> wise segregation .
>
> i tried to define this but it doesn't work appropriate . My dashboard
> pick the filter on the basis of labels .
>
> Thanks in Advance .
>
> - job_name: postgres_exporter_lr-1m0s
>
> scrape_interval: 10s
>
> scrape_timeout: 10s
>
> metrics_path: /metrics
>
> static_configs:
>
> - targets:
>
> - x.x.x.x:9187
>
> - y.y.y.y:9187
>
> labels:
>
> agent_type: postgres_exporter
>
> node_name: ip-x.x.x.x
>
> node_name: ip-y.y.y.y
>
> node_type: generic
>
> region: eastus1
>
> service_type: postgresql
>
> service_name: ip-x.x.x.x
>
> service_name: ip-y.y.y.y
>
--
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/3598afe3-91b0-47bd-a698-31ee83441c1f%40googlegroups.com.