Dynamically create recording rules

36 views
Skip to first unread message

we...@kubecost.com

unread,
Aug 6, 2020, 3:36:03 PM8/6/20
to Prometheus Users
Hi all,

We're looking to dynamically create/edit recording rules. Does anyone know a way to do this at run-time without using a sidecar or modifying the rule_files directly? For example, is there an API that would allow this and then we can pass SIGHUP after calling? 

Thank you much in advance!

Stuart Clark

unread,
Aug 6, 2020, 3:59:48 PM8/6/20
to we...@kubecost.com, Prometheus Users
You need to update the files. If you want some form of API you'd need a
sidecar to manage that.

Julien Pivotto

unread,
Aug 6, 2020, 4:00:38 PM8/6/20
to Stuart Clark, we...@kubecost.com, Prometheus Users
However please note that rule_files takes glob, e.g. rules*.yml.
>
> --
> 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/2fa3a2b9-4cf7-8af4-9b50-249d02af5c2a%40Jahingo.com.

--
Julien Pivotto
@roidelapluie

Julien Pivotto

unread,
Aug 6, 2020, 4:02:21 PM8/6/20
to Stuart Clark, we...@kubecost.com, Prometheus Users
On 06 Aug 22:00, Julien Pivotto wrote:
> On 06 Aug 20:59, Stuart Clark wrote:
> > On 06/08/2020 20:36, we...@kubecost.com wrote:
> > > Hi all,
> > >
> > > We're looking to dynamically create/edit recording rules. Does anyone
> > > know a way to do this at run-time without using a sidecar or modifying
> > > the rule_files directly? For example, is there an API that would allow
> > > this and then we can pass SIGHUP after calling?
> > >
> >
> > You need to update the files. If you want some form of API you'd need a
> > sidecar to manage that.
>
> However please note that rule_files takes glob, e.g. rules*.yml.


to be clear that means that with a configmap and /-/reload you don't
need a side car AFAIK

> >
> > --
> > 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/2fa3a2b9-4cf7-8af4-9b50-249d02af5c2a%40Jahingo.com.
>
> --
> Julien Pivotto
> @roidelapluie

--
Julien Pivotto
@roidelapluie

we...@kubecost.com

unread,
Aug 6, 2020, 9:36:37 PM8/6/20
to Prometheus Users
Greatly appreciate the quick responses guys! Thanks so much.

@Julien, do you have any recommended documentation/code to review for using a configmap directly?

Reply all
Reply to author
Forward
0 new messages