Manage target.yml

43 views
Skip to first unread message

ritesh patel

unread,
Mar 23, 2022, 2:58:01 AM3/23/22
to promethe...@googlegroups.com
Hello Team,

Hope You are doing well šŸ˜

I have prometheus running on docker and My all targets are managed from targets.yml, now I want to know that can I manage this Targets.yml from puppet so if any new host spin up not required to add manually on targets.Ā 

Any one have any idea about this? How it’s work and any flow chart for how I can manage targets.yml from puppet.Ā 

Thanks andĀ regards
Ritesh patelĀ 

ritesh patel

unread,
Mar 25, 2022, 1:28:57 AM3/25/22
to promethe...@googlegroups.com
Team anyone have idea about this?Ā 

Brian Candler

unread,
Mar 25, 2022, 4:41:08 AM3/25/22
to Prometheus Users
> so if any new host spin up not required to add manually on targets

That depends on how you are detecting the new hosts which are spun up.Ā  Prometheus normally does this using "service discovery".Ā  You are currently using the "file" service discovery mechanism, which reads your targets.yml file, but there are many other options which you can read about in the prometheus documentation.

For example, if you are spinning up hosts as AWS EC2 instances, then you can use EC2 service discovery:Ā https://prometheus.io/docs/prometheus/latest/configuration/configuration/#ec2_sd_config

> I want to know that can I manage this Targets.yml from puppetĀ 

If you wish to continue using the file service discovery mechanism (i.e. use targets.yml and manage it through puppet), then it's up to you to work out how to detect a new hosts, update targets.yml, and push it out.

Julien Pivotto

unread,
Mar 25, 2022, 5:51:05 AM3/25/22
to Brian Candler, Prometheus Users
If you are using puppetdb, you can use puppetdb_sd_configs to discover your targets automatically.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f006628b-5d86-4987-a4a2-987ebb4df1fan%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages