blackbox_exporter multiple checks on aws discovered hosts

357 views
Skip to first unread message

Yosef Yudilevich

unread,
Jun 25, 2017, 6:50:03 AM6/25/17
to Prometheus Users
working with "ec2_sd_configs"

need to run 10 and more http checks on every discovered target ip

couldnt find simple way to do it

may be someone can help?

thanks

Yosef Yudilevich

unread,
Jun 25, 2017, 9:54:52 AM6/25/17
to Prometheus Users
meaning situation like:

...


so we could have some list like
- /test1
- :8080/test2
...
- :8080/test50

and that could be applied to each discovered host





its not very easy to create job for every such test when you have say 50 of them
(of cause new exporter is an option but if could work out of the box could be nice)

i have no idea how it could work with the way blackbox_exporter works but may be someone have  idea

Nicholas Capo

unread,
Jun 25, 2017, 2:19:44 PM6/25/17
to Yosef Yudilevich, Prometheus Users

It is expected that your configuration management system would take care of that (e.g. Salstack, Ansible, Chef, Puppet, etc). The Prometheus configs are intentially simple to allow easy generation.

In my case I'm using Salstack to template out my Prometheus config, so I can use Jinja loops for repetition.

If you aren't using a config management system, you could always write a simple script to spit out a complete config.

Nicholas


--
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/1ecd66e4-5e90-4147-baa1-7d4161980115%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yosef Yudilevich

unread,
Jun 25, 2017, 7:39:41 PM6/25/17
to Prometheus Users
do you generate job for every uri?
or what is the setup?

thanks

Nicholas Capo

unread,
Jun 25, 2017, 8:33:02 PM6/25/17
to Yosef Yudilevich, Prometheus Users

I have a list of sites I need to monitor with the blackbox exporter. The template takes the list and generates targets for each site with appropriate labels, etc. In my case it's all the same job, just different scrape target parameters.

Nicholas


--
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.

Yosef Yudilevich

unread,
Jun 26, 2017, 1:30:43 AM6/26/17
to Prometheus Users
that is not situation i am talking about
i have list of sites too, but each site has big amount of checks (api)

then for each (uri) check (i think) i have to create another job

but i thought may be i am missing something

thanks


On Sunday, June 25, 2017 at 1:50:03 PM UTC+3, Yosef Yudilevich wrote:

Ben Kochie

unread,
Jun 26, 2017, 2:53:21 AM6/26/17
to Yosef Yudilevich, Prometheus Users
I think the difficulty here is that you are trying to generate multiple target instances for each input discovered by ec2_sd_configs.  This is not going to be possible because there is a 1-to-1 relationship between discovered targets and output targets (except in the case that you drop in relabeling).  You can't have more targets than ec2_sd_configs returns in its list.

So you are right, you will have to have a job for each url if you want to use ec2_sd_configs directly.  Then it will automatically populate.  This of course means you will need 10+ job depending on each URL pattern you want to monitor.

This isn't optimal, but should be easily generated by most config management systems.

I think this is a case where you may want to skip the built-in discovery and write a custom discovery generator that reads your ec2 inventory and writes out a target file with all the URLs.  This way it can be one blackbox exporter job, with all the targets populated in a file_sd_config.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/24a2f261-a371-4668-a7b2-1a0a952bc036%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages