How to dynamically add alerts rules in rules.conf and prometheus yml file via API or something

2,292 views
Skip to first unread message

ranjith...@gmail.com

unread,
May 18, 2018, 2:00:57 AM5/18/18
to Prometheus Users
How to dynamically add alerts rules in rules.conf and prometheus yml file via API or something in Promtheus. I have added prometheus stack for monitoring Rancher server. I have tried configuring alerts in prometheus stack by manually. It worked. Now i want to add the rules and configure webhooks in alertmanager config yml file dyanmically. Is there anyway I can do that?? Do they have API for this scenario?

Simon Pasquier

unread,
May 18, 2018, 4:24:54 AM5/18/18
to ranjith...@gmail.com, Prometheus Users
There's no API to create/update/delete alerting rules in Prometheus (the same for webhooks in AlertManager). And there's also no plan to add it in the future.

On Fri, May 18, 2018 at 8:00 AM, <ranjith...@gmail.com> wrote:
How to dynamically add alerts rules in rules.conf and prometheus yml file via API or something in Promtheus. I have added prometheus stack for monitoring Rancher server. I have tried configuring alerts in prometheus stack by manually. It worked. Now i want to add the rules and configure webhooks in alertmanager config yml file dyanmically. Is there anyway I can do that?? Do they have API for this scenario?

--
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/bd698400-b458-456c-9c74-3c70c4309480%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ranjith...@gmail.com

unread,
May 18, 2018, 4:51:11 AM5/18/18
to Prometheus Users
Thanks for the reply. Is there any way I can edit the configuration files dynamically or programmically other than manually editing these files?


On Friday, May 18, 2018 at 1:54:54 PM UTC+5:30, Simon Pasquier wrote:
There's no API to create/update/delete alerting rules in Prometheus (the same for webhooks in AlertManager). And there's also no plan to add it in the future.
On Fri, May 18, 2018 at 8:00 AM, <ranjith...@gmail.com> wrote:
How to dynamically add alerts rules in rules.conf and prometheus yml file via API or something in Promtheus. I have added prometheus stack for monitoring Rancher server. I have tried configuring alerts in prometheus stack by manually. It worked. Now i want to add the rules and configure webhooks in alertmanager config yml file dyanmically. Is there anyway I can do that?? Do they have API for this scenario?

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

Simon Pasquier

unread,
May 18, 2018, 5:24:19 AM5/18/18
to ranjith...@gmail.com, Prometheus Users
On Fri, May 18, 2018 at 10:51 AM, <ranjith...@gmail.com> wrote:
Thanks for the reply. Is there any way I can edit the configuration files dynamically or programmically other than manually editing these files?

You need to pick a configuration management system such as Puppet, Chef, Ansible, Salt, ...
 

On Friday, May 18, 2018 at 1:54:54 PM UTC+5:30, Simon Pasquier wrote:
There's no API to create/update/delete alerting rules in Prometheus (the same for webhooks in AlertManager). And there's also no plan to add it in the future.

On Fri, May 18, 2018 at 8:00 AM, <ranjith...@gmail.com> wrote:
How to dynamically add alerts rules in rules.conf and prometheus yml file via API or something in Promtheus. I have added prometheus stack for monitoring Rancher server. I have tried configuring alerts in prometheus stack by manually. It worked. Now i want to add the rules and configure webhooks in alertmanager config yml file dyanmically. Is there anyway I can do that?? Do they have API for this scenario?

--
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/bd698400-b458-456c-9c74-3c70c4309480%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/6d93abb6-61a2-408d-a87a-ca1ab2629aeb%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages