Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prometheus does not push alerts to AlertManager

Prometheus fires alerts as show

Alert Manager mapping

NoAlerts in AlertManager

Although Prometheus says that the alerts are fired, my alert manager does not receive any alerts. It says "No Alerts".

This is just for testing purposes in my local machine. Here is my prometheus.yml

--- 
rule_files: 
  - ~/Documents/prometheus-data/alert.rules
scrape_configs: 
  - job_name: node
    scrape_interval: 15s
    static_configs: 
      - targets: 
          - "127.0.0.1:9100"

I use the following command to start prometheus.

./prometheus -config.file=prometheus.yml -alertmanager.url=http://127.0.0.1:9093

Am I missing anything?

like image 889
schuma Avatar asked Mar 19 '26 18:03

schuma


1 Answers

I believe the issue is the path to your rules file at ~/Documents/prometheus-data/alert.rules, notably the ~ character.

Moving the rules rules file to the same directory as Prometheus and referencing it as just alert.rules worked for me when I tested your setup. I also tested removing the ~ character and using the absolute path to the alert.rules file which also worked.

like image 91
Conor Avatar answered Mar 22 '26 18:03

Conor