Hi , 

Thanks for your valuable suggestion which help me to use config file in 
proper way .  i tired to use this config to achieve the same and 
everything is working fine except node_name as label  which is unique for 
each target . i want to replace or append node_name as label in 
target_label with _address_ value  . But it doesn't work with 
relabel_config . Can you please suggest for the same . 

  file_sd_configs:

    - files:

      - /etc/prometheus/targets.yaml

  relabel_configs:

    - source_labels: [_address_]

      regex: '172*'

      replacement: '$1'

      target_label: node_name

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/79093a42-7bb2-4b6a-8a1e-a0898c959dd4%40googlegroups.com.

Reply via email to