Well, I found out that there is an option for debugging by adding command line 
option "--log.level=debug". However, I had to use the executable version 
instead of running from a docker container. When I do that, it was able to load 
my rules. So I am able to proceed with testing the alert rules.

Thanks for the suggestions. Augustin, if you look in the default prometheus.yml 
that comes with the software, it shows using "first.rules", "second.rules". I 
also googled and found there were discussions about people having trouble with 
using /etc/prometheus/rules.d/*/*.yml and the discussion seems to suggest that 
the software was expecting the rule files to be name *.rules. Originally I used 
"alert.rules.yml".


Derek
________________________________
From: [email protected] <[email protected]> on 
behalf of Augustin Husson <[email protected]>
Sent: Saturday, April 18, 2020 2:09 AM
To: Brian Candler <[email protected]>
Cc: Prometheus Users <[email protected]>
Subject: Re: [prometheus-users] how to troubleshoot alert rule not loading

Well a way to avoid these questions would be to use first an absolute path.

At least it will help you to understand why Prometheus doesn't find your file.

Le sam. 18 avr. 2020 à 09:54, Brian Candler 
<[email protected]<mailto:[email protected]>> a écrit :
On Saturday, 18 April 2020 01:15:12 UTC+1, Augustin Husson wrote:
check that the alertRule file is in the same directory than the prometheus 
binary.


If you use relative paths, I believe they are relative to the directory 
containing the prometheus.yml file (not the directory containing the binary, 
nor the cwd)

I have:

/opt/prometheus/prometheus  # the binary

/etc/systemd/system/prometheus.service
...
WorkingDirectory=/opt/prometheus
/etc/prometheus/prometheus.yml
...
rule_files:
  - "rules/*.yml"

/etc/prometheus/rules/whatever.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 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/0dd8287e-70c5-408a-927c-4202996ced63%40googlegroups.com<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fprometheus-users%2F0dd8287e-70c5-408a-927c-4202996ced63%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=02%7C01%7Cderek.lai%40inmobi.com%7Cbe10a8d18f9d4cd6e7d308d7e3782de4%7C89359cf49e60409980c4775a0cfe27a7%7C0%7C0%7C637227977664818788&sdata=g6LVXQIsl7dVtqlwyLwOwJGRbmxzkH4mEHDdPidWTQ4%3D&reserved=0>.

--
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 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAOJizGfM9E%3DUO04H9v1XYoULAPUTTQNEPGEpzxG8Oe_acccKAw%40mail.gmail.com<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fprometheus-users%2FCAOJizGfM9E%253DUO04H9v1XYoULAPUTTQNEPGEpzxG8Oe_acccKAw%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=02%7C01%7Cderek.lai%40inmobi.com%7Cbe10a8d18f9d4cd6e7d308d7e3782de4%7C89359cf49e60409980c4775a0cfe27a7%7C0%7C0%7C637227977664828790&sdata=PqNm2pO%2Fd4LJb0JtoOwoC7roEoNJu5eLA9yXnr2hgWI%3D&reserved=0>.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/MA1PR01MB305205203B27283ACD8058F88CD60%40MA1PR01MB3052.INDPRD01.PROD.OUTLOOK.COM.

Reply via email to