Azure_sd_config

196 views
Skip to first unread message

ah...@reezocar.com

unread,
May 23, 2019, 9:38:39 AM5/23/19
to Prometheus Users
hello everyone!

I am using azure sd config to discover hosts on azure to scrape haproxy metrics but not all the hosts are needed to be shown on. how can i configure my azure_sd_config to only have the hosts of haproxy ?


- job_name: service-azure-haproxy
        azure_sd_configs
:
         
- environment: AzurePublicCloud
            authentication_method
: OAuth
            subscription_id
: XXXXXXXXXXX
            tenant_id
: XXXXXXXXXXX
            client_id
: XXXXXXXXX
            client_secret
: XXXXXXXXXXX
            refresh_interval
: 300s
            port
: 9101
        relabel_configs
:
         
- source_labels: [__meta_azure_machine_name]
            target_label
: machine_name
         
- source_labels: [__meta_azure_machine_tag_env]
            target_label
: env

Simon Pasquier

unread,
May 24, 2019, 9:12:39 AM5/24/19
to ah...@reezocar.com, Prometheus Users
One way would be to tag your HAProxy hosts and use relabeling to
filter those instances. For example, if you tag them with
"haproxy=true":

- job_name: haproxy
azure_sd_configs:
- ...
relabel_configs:
- source_labels: [__meta_azure_machine_tag_haproxy]
regex: "true"
action: keep
- ...
> --
> 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 prometheus-use...@googlegroups.com.
> To post to this group, send email to promethe...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/58e42c79-f855-4415-aba2-a829681351a0%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

ah...@reezocar.com

unread,
May 24, 2019, 10:56:59 AM5/24/19
to Prometheus Users
thank you a looot ! :D
> To unsubscribe from this group and stop receiving emails from it, send an email to promethe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages