Prometheus configuration management

92 views
Skip to first unread message

huihui...@gmail.com

unread,
Jun 12, 2017, 10:14:35 AM6/12/17
to Prometheus Users
Every time I want to add a job, I can only modify the configuration file, and then reload prometheus.
Is there any tool to add a job to the graphical interface without having to manually modify the configuration file?
On the page of http://localhost:9090/, you can not modify the configuration file.
The configuration of alertmanager has the same question.

Conor Broderick

unread,
Jun 12, 2017, 10:18:25 AM6/12/17
to huihui...@gmail.com, Prometheus Users
There isn't any tool to modify either the Prometheus or Alertmanager's configuration files. 

The recommended approach to achieve something like this is to build your own solution to do so.

--
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/6fb14054-681c-4a6d-9585-5b50f2c35dca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Mark Smith

unread,
Jun 12, 2017, 3:48:46 PM6/12/17
to promethe...@googlegroups.com
As an example of build-your-own, here at my company we have written a small Python script (~300 LOC) that integrates with our machine/service database system and our deployment system. The deployment system runs it on every Prometheus server every 15 minutes, where it then writes out a new config file based on the data from our machine/service database and (if needed) sends SIGHUP to the Prometheus server.

So, the integration is pretty straightforward and doesn't take a ton of work to do. I cobbled it together over a weekend (which was mostly time spent on getting the rules right so we would stop destroying our Prometheus servers).

If you're a smaller site, even just writing a small script and running it via cron is probably good enough. If you're using AWS or Google Cloud or something else they all provide APIs for discovery so you can just automate that function to write out the desired targets file. (And I'd probably recommend that over manually updating, it'll ultimately save you time spent on configuration...and misconfiguration.)

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

huihui...@gmail.com

unread,
Jun 13, 2017, 3:51:54 AM6/13/17
to Prometheus Users
Thanks for your answer!
Actually I have built a sample web page to modify the yml file and update the configuration, just as below:

But for a person who has not come into contact with prometheus, it is difficult for him to modify the configuration file directly.
My current idea is to map the entire yml file to an object, and the user only needs to add the job to the interface, and we will map it to the yml file


On Tuesday, June 13, 2017 at 3:48:46 AM UTC+8, Mark Smith wrote:
As an example of build-your-own, here at my company we have written a small Python script (~300 LOC) that integrates with our machine/service database system and our deployment system. The deployment system runs it on every Prometheus server every 15 minutes, where it then writes out a new config file based on the data from our machine/service database and (if needed) sends SIGHUP to the Prometheus server.

So, the integration is pretty straightforward and doesn't take a ton of work to do. I cobbled it together over a weekend (which was mostly time spent on getting the rules right so we would stop destroying our Prometheus servers).

If you're a smaller site, even just writing a small script and running it via cron is probably good enough. If you're using AWS or Google Cloud or something else they all provide APIs for discovery so you can just automate that function to write out the desired targets file. (And I'd probably recommend that over manually updating, it'll ultimately save you time spent on configuration...and misconfiguration.)

--
Mark Smith


On Mon, Jun 12, 2017, at 07:18 AM, Conor Broderick wrote:
There isn't any tool to modify either the Prometheus or Alertmanager's configuration files. 

The recommended approach to achieve something like this is to build your own solution to do so.
On 12 June 2017 at 15:14, <huihui...@gmail.com> wrote:
Every time I want to add a job, I can only modify the configuration file, and then reload prometheus.
Is there any tool to add a job to the graphical interface without having to manually modify the configuration file?
On the page of http://localhost:9090/, you can not modify the configuration file.
The configuration of alertmanager has the same question.


--
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/6fb14054-681c-4a6d-9585-5b50f2c35dca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Conor Broderick

govinda...@gmail.com

unread,
Jun 13, 2017, 1:14:24 PM6/13/17
to Prometheus Users
Dashboard looks nice. Do you have it somewhere on gitrepo to clone?

huihui...@gmail.com

unread,
Jun 14, 2017, 2:57:52 AM6/14/17
to Prometheus Users, govinda...@gmail.com
I am sorry, the code of dashboard is with the company's project, I can not make it public for the time being
Reply all
Reply to author
Forward
0 new messages