Prometheus does not push alerts to AlertManager

7.5k views Asked by At

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?

1

There are 1 answers

1
Conor On BEST ANSWER

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.