3

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?

schuma
  • 47
  • 1
  • 4

1 Answers1

1

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.

Conor
  • 3,279
  • 1
  • 21
  • 35
  • Thanks, that was one of the issues. Another one was the issue with my alert-manager config file for slack notifications. My configuration was wrong. – schuma Sep 08 '17 at 09:12