Prometheus Server does not read recording rule file

23 views
Skip to first unread message

Steve

unread,
Feb 15, 2020, 5:18:52 PM2/15/20
to Prometheus Users
Hi
I am struggling with a simple problem.
My Prometheus Server (running in a container) does not want to read the recording rule defined in a recording rule file.

The recording file has successfully passed the unit test as follows:

  SUCCESS: 1 rules found


The prometheus.yml is properly configured with the recording rule file.

I can see the running configuration as  follows:

rule_files: - /root/steve-recording-rules-1.yml


But  when I check the Prometheus UI, I see no recording rules:


I also don't find the new metric name in the expression browser.


This is strange!


-Steve


Julien Pivotto

unread,
Feb 15, 2020, 5:25:25 PM2/15/20
to Steve, Prometheus Users
On 15 Feb 14:18, Steve wrote:
> Hi
> I am struggling with a simple problem.
> My Prometheus Server (running in a container) does not want to read the
> recording rule defined in a recording rule file.
>
> The recording file has successfully passed the unit test as follows:
>
> SUCCESS: 1 rules found
>
>
> The prometheus.yml is properly configured with the recording rule file.
>
> I can see the running configuration as follows:
>
> rule_files: - /root/steve-recording-rules-1.yml
>
>
> But when I check the Prometheus UI, I see no recording rules:

rule_files:
- /root/steve-recording-rules-1.yml

This is file globbing. What is means is that prometheus can also take
e.g. * to read multiple files.
The consequence of this is that prometheus will NOT error if
/root/steve-recording-rules-1.yml does not exist.

I would suggest you verify that your prometheus user can read the file
in this location, and that the filename is correct. Is the file
collectly added/mounted in the container?

>
>
> I also don't find the new metric name in the expression browser.
>
>
> This is strange!
>
>
> -Steve
>
>
> --
> 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/9124ea10-e9bf-4152-9271-57f07c15622d%40googlegroups.com.


--
(o- Julien Pivotto
//\ Open-Source Consultant
V_/_ Inuits - https://www.inuits.eu
signature.asc

Steve

unread,
Feb 15, 2020, 6:15:04 PM2/15/20
to Prometheus Users
Thank you Julien
I got it working !
Have a nice weekend!

-Steve

Reply all
Reply to author
Forward
0 new messages