For a particular job in Prometheus, it seems like the typical config is something like this:
static_configs:
- targets: ['localhost:9090']
But in the case where I want a dynamic list of hosts, what would be the approach there? I was looking at scrape_config
but that doesn't seem to accomplish what I'm after (unless I'm misreading?).
Thank you in advance!
Prometheus has a scraping configuration that allows you to add target you want to scrape. This is the documentation (a good starting point). Thanks for the answer. I actually fixed it mapping these configs by editing the configmap.
A scrape_config section specifies a set of targets and parameters describing how to scrape them. In the general case, one scrape configuration specifies a single job. In advanced configurations, this may change.
If one of the provided service discovery mechanisms doesn't already do what you need, you can use file_sd_configs to provide targets on the fly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With