schuma
schuma

Reputation: 57

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?

Upvotes: 4

Views: 7971

Answers (1)

Conor
Conor

Reputation: 3579

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.

Upvotes: 1

Related Questions