grafana / alerting

Set of libraries used to build alerting systems at Grafana - including the Alertmanager.
GNU Affero General Public License v3.0
47 stars 42 forks source link

Review discrepancies between Grafana and Alertmanager contact points #20

Open yuri-tceretian opened 1 year ago

yuri-tceretian commented 1 year ago

This is part of the process of unification of Alertmanagers (Mimir and Grafana). Grafana notifiers are derived from the legacy alerting system and have different formats of configuration, use different ways of communicating with the APIs, etc. Therefore, to unify (or not) notifiers we need to review the discrepancies, document them, and then make decisions in each case.

Alertmanager notifiers:

Notifier Mimir Grafana
Alertmanager 🔲 :white_check_mark:
Ding Ding 🔲 :white_check_mark:
Discord :white_check_mark: :white_check_mark:
Email :white_check_mark: :white_check_mark: link
Google Chat 🔲 :white_check_mark:
Kafka 🔲 :white_check_mark:
LINE 🔲 :white_check_mark:
OPS Genie :white_check_mark: :white_check_mark: link
PagerDuty :white_check_mark: :white_check_mark: link
Pushover :white_check_mark: :white_check_mark:
Sensugo 🔲 :white_check_mark:
Slack :white_check_mark: :white_check_mark:
SNS :white_check_mark: 🔲
MS Teams 🔲 :white_check_mark:
Telegram :white_check_mark: :white_check_mark: link
Threema 🔲 :white_check_mark:
VictorOps :white_check_mark: :white_check_mark:
Webex :white_check_mark: :white_check_mark:
Webhook :white_check_mark: :white_check_mark:
WeChat :white_check_mark: 🔲
WeCom 🔲 :white_check_mark:

Global difference:

yuri-tceretian commented 1 year ago

Telegram

Alertmanager:

Setting Type Requried Default
api_url URL Global telegram_api_url, https://api.telegram.org
bot_token Secret yes
chat_id int64 > 0
message string {{ template "telegram.default.message" . }}
disable_notifications bool false
parse_mode string: Markdown, MarkdownV2, HTML HTML

Grafana

Setting Type Requried Default
bottoken encrypted yes
chat_id string yes
message string {{ template "default.message" . }}
disable_notifications* bool false
parse_mode* string: Markdown, MarkdownV2, HTML HTML

* - since Grafana 9.4.0

yuri-tceretian commented 1 year ago

PagerDuty

Alertmanager

Setting Type Requried Default
service_key Secret yes*
service_key_file string yes*
routing_key Secret yes*
routing_key_file string yes*
url URL https://events.pagerduty.com/v2/enqueue
client string {{ template "pagerduty.default.client" . }}
client_url string {{ template "pagerduty.default.clientURL" . }}
description string {{ template "pagerduty.default.description" .}}
details map[string]string **
images []PagerdutyImage
links []PagerdutyLink
source string same as client
severity string error
class string
component string
group string

* One of the fields must be specified.

** Default details

{
"firing":       "{{ template "pagerduty.default.instances" .Alerts.Firing }}",
"resolved":     "{{ template "pagerduty.default.instances" .Alerts.Resolved }}",
"num_firing":   "{{ .Alerts.Firing | len }}",
"num_resolved": "{{ .Alerts.Resolved | len }}"
}

PagerdutyImage:

Setting Type Requried Default
src string
alt string
href string

PagerdutyLink:

Setting Type Requried Default
href string
text string

Grafana

Setting Type Requried Default Equivalent in Alertmanager
integrationKey string yes routing_key
severity string "critical" severity
class string "default" class
component string "Grafana" component
group string "default" group
summary string {{ template "default.title" . }} description
source* string hostname and if error - client source
client* string "Grafana" client
client_url* string {{ .ExternalURL }} client_url

* - added in Grafana 9.4

yuri-tceretian commented 1 year ago

OpsGenie

Alertmanager

Setting Type Requried Default
api_key Secret yes*
api_key_file string yes*
api_url URL https://api.opsgenie.com/
message string {{ template "opsgenie.default.message" . }}
description string {{ template "opsgenie.default.description" . }}
source string {{ template "opsgenie.default.source" . }}
details map[string]string
entity string
responders []OpsGenieConfigResponder
actions string
tags string
note string
priority string
update_alerts bool

* - either option must be specified

OpsGenieConfigResponder

Setting Type Requried Default
id string yes*
name string yes*
username string yes*
type string yes

* - either option must be specified

Grafana

Setting Type Requried Default Equivalent in Alertmanager
apiKey string api_key
apiUrl string https://api.opsgenie.com/v2/alerts api_url
message string message
description string description
autoClose bool
overridePriority bool
sendTagsAs string
yuri-tceretian commented 1 year ago

Email

Summary:

Alertmanager

Setting Type Requried Default
to string yes
from string yes *
hello string * "localhost"
smarthost HostPort yes *
auth_username string *
auth_password Secret **
auth_password_file string **
auth_secret Secret *
auth_identity string *
headers map[string]string ***
html string {{ template "email.default.html" . }}
text string
require_tls bool * true
tls_config commoncfg.TLSConfig

* if setting is empty, it checks the global setting. The global setting defaults to empty value unless setting is specified in the table above.

** if both fields auth_password and auth_password_file are not specified defaults to the global setting

*** Default headers:

Notable differences:

Grafana

Setting Type Requried Default Equivalent in Alertmanager
singleEmail bool false
addresses string true to *
message string
subject string {{ template "default.title" . }} header "Subject"

* acceptible format for addresses is more relaxed. Accepted a string that is delimited by any of the following characters (\n, ,, ;)

Notable differences: