Prometheus absolutely does do dynamic discovery.

See the scrape_config section of the docs:
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config

There are 16 available XXX_sd_configs options there. If your source of
truth isn't listed, you can either write your own adapter using
file_sd_configs as an API. Or if you think your system is popular enough,
contribute it to the codebase.

There is a growing list of adapters here:
https://prometheus.io/docs/operating/integrations/#file-service-discovery

On Fri, Feb 19, 2021 at 11:19 PM Gajendra Ambi <[email protected]> wrote:

> Hi,
> I too just discovered that it does not do dynamic discovery. I have to
> tell prometheus to see it by using file based discovery in prometheus. This
> is very unfortunate where we have 100s of nodes and growing and each group
> of devs who own them get to add them when they want. Currently it seems We
> have to do it manually. Thanks for the quick info.
>
> On Saturday, February 20, 2021 at 3:33:47 AM UTC+5:30 Julien Pivotto wrote:
>
>> On 19 Feb 14:00, Gajendra Ambi wrote:
>> > Everyone gives the same link
>> >
>> https://prometheus.io/docs/prometheus/latest/configuration/configuration
>> when
>> > asked about auto discovery of physical nodes but the entire page has
>> only 2
>> > occurences of the word auto-discovery.
>> > We have 700+ physical servers and Prometheus is running on k8s (targets
>> are
>> > not part of k8s). Can someone please point to a blog or the actual part
>> of
>> > the documentation which has auto discovery of physical nodes, not the
>> same
>> > link please. I could not find anything there. It says, you can do it
>> using
>> > 1 of the auto discovery methods but the link does not have a single
>> method
>> > of auto discovery listed there.
>>
>> Hello,
>>
>> Prometheus does not do *auto* discovery. We do *service* discovery. You
>> will need a source of truth where your register your nodes.
>>
>>
>> >
>> > On Monday, September 3, 2018 at 7:44:49 PM UTC+5:30 HARSH AGARWAL
>> wrote:
>> >
>> > > You can use Prometheus-service-discovery(SD) to automatically
>> discover the
>> > > targets.
>> > >
>> https://prometheus.io/docs/prometheus/latest/configuration/configuration
>> > >
>> > > Using relabel-configs
>> > > <
>> https://prometheus.io/docs/prometheus/latest/configuration/configuration/#%3Crelabel_config%3E>,
>>
>> > > you can specify which targets you want to keep/discard/change-labels,
>> etc.
>> > >
>> > > Prometheus supports SD for many providers. You can also use your
>> > > own custom-service-discovery mechanisms using file_sd
>> > > <
>> https://prometheus.io/docs/prometheus/latest/configuration/configuration/#%3Cfile_sd_config%3E>
>>
>> > > .
>> > >
>> > >
>> > > On Monday, September 3, 2018 at 7:36:28 PM UTC+5:30, HJS wrote:
>> > >>
>> > >> 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((auto discover
>> of
>> > >> targets)), this option is available in prometheus and if available
>> how can
>> > >> config??
>> > >>
>> > >>
>> > >> Thank you in advance!
>> > >>
>> > >>
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "Prometheus Developers" 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-developers/cfc35736-9321-438e-8692-c3591ef2e550n%40googlegroups.com.
>>
>>
>>
>> --
>> Julien Pivotto
>> @roidelapluie
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Developers" 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-developers/be0fbf93-357f-403a-8f8f-b70140ead2den%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-developers/be0fbf93-357f-403a-8f8f-b70140ead2den%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Developers" 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-developers/CABbyFmqHj_SHfATx2DcHrxCB0mu56d0gwrx5cQsG23mcm%3DdSmg%40mail.gmail.com.

Reply via email to