Prometheus alertmanager: Difference between revisions

From wikinotes
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 15: Line 15:
</blockquote><!-- Documentation -->
</blockquote><!-- Documentation -->


= Locations =
= Tutorials =
<blockquote>
{| class="wikitable"
|-
| grafana/pagerduty tutorial || https://grafana.com/blog/2020/02/25/step-by-step-guide-to-setting-up-prometheus-alertmanager-with-slack-pagerduty-and-gmail/
|-
|}
</blockquote><!-- Tutorials -->
 
= Routes =
<blockquote>
<blockquote>
{| class="wikitable"
{| class="wikitable"
Line 22: Line 31:
|-
|-
| <code>http://localhost:9093</code> || alertmanager ui
| <code>http://localhost:9093</code> || alertmanager ui
|-
|}
</blockquote><!-- Routes -->
= Locations =
<blockquote>
{| class="wikitable"
|-
|-
| <code>${PREFIX}/etc/alertmanager/alertmanager.yml</code> || alertmanager config
| <code>${PREFIX}/etc/alertmanager/alertmanager.yml</code> || alertmanager config
|-
|-
| <code>${PREFIX}/etc/prometheus.yml</code> || prometheus config
| <code>${PREFIX}/etc/prometheus.yml</code> || prometheus config
|-
| <code>/var/log/alertmanager.log</code> || default-log (unless alt syslog service - see [[alertmanager install]].)
|-
|  <code>/var/db/alertmanager</code> || data dir
|-
|}
|}
</blockquote><!-- Locations -->
</blockquote><!-- Locations -->
Line 40: Line 61:
|-
|-
| [[alertmanager usage]]
| [[alertmanager usage]]
|-
| [[alertmanager debugging]]
|-
|-
|}
|}

Latest revision as of 21:09, 20 February 2022

Alertmanager is the official service prometheus communicates with to issue alerts.

Documentation

repo https://github.com/prometheus/alertmanager
official docs https://prometheus.io/docs/alerting/latest/configuration/
sample config https://github.com/prometheus/alertmanager#example
template docs https://prometheus.io/docs/prometheus/latest/configuration/template_examples/

Tutorials

grafana/pagerduty tutorial https://grafana.com/blog/2020/02/25/step-by-step-guide-to-setting-up-prometheus-alertmanager-with-slack-pagerduty-and-gmail/

Routes

9093 default port that receives alerts
http://localhost:9093 alertmanager ui

Locations

${PREFIX}/etc/alertmanager/alertmanager.yml alertmanager config
${PREFIX}/etc/prometheus.yml prometheus config
/var/log/alertmanager.log default-log (unless alt syslog service - see alertmanager install.)
/var/db/alertmanager data dir

Notes

alertmanager install
alertmanager configuration
alertmanager configurations
alertmanager usage
alertmanager debugging

Usage

amtool check-config alertmanager.yml  # validate an alertmanager config

trigger a fake alert (source)

#! /usr/bin/env sh

URL="http://localhost:9093/api/v1/alerts"

curl -si -X POST -H "Content-Type: application/json" "$URL" -d '
[
  {
    "labels": {
      "alertname": "InstanceDown",
      "instance": "localhost:8080",
      "job": "node",
      "severity": "critical"
    },
    "annotations": {
      "summary": "Instance is down"
    },
    "generatorURL": "http://localhost:9090/graph"
  }
]
'