Comments (4)
Telegram
Alertmanager:
- Uses telebot.v3 package to send notifications
- set "disable web page preview" to true
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
- Supports images
- Uses Grafana webhook notifier
- Api URL is hardcoded to
"https://api.telegram.org/bot%s/%s"
where first is bot-token and second is action (sendMessage, sendPhoto) - parse_mode is hardcoded to HTML
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
from alerting.
PagerDuty
Alertmanager
- Uses V1 API if either
service_key
orservice_key_file
are specified. Otherwise, uses V2 API - If uses V1 API, retries on status 403
- If uses V2 API, retries on status 429
- Incident key of the V1 payload is a hash of the group key
routing_key
can be a template!
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
- Supports only V2 API
- Does not retry?
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
client_details
are hardcoded
{
"firing": `{{ template "__text_alert_list" .Alerts.Firing }}`,
"resolved": `{{ template "__text_alert_list" .Alerts.Resolved }}`,
"num_firing": `{{ .Alerts.Firing | len }}`,
"num_resolved": `{{ .Alerts.Resolved | len }}`,
}
links
hardcoded to Grafana URLurl
is hardcoded tohttps://events.pagerduty.com/v2/enqueue
from alerting.
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
type
must match^(team|teams|user|escalation|schedule)$
(case insensitive)
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 |
source
is hardcoded to "Grafana"tags
are hardcoded to alert group CommonLabels labels. Sent only if sendTagsAstags
orboth
. In AM tags are configured- labels values in
details
support templates (bug?) autoClose
is not supported in AM
from alerting.
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:
- "Subject":
{{ template "email.default.subject" . }}
- "To" is config.To
- "From"is config.From
- "Message-Id" =
fmt.Sprintf("<%d.%d@%s>", time.Now().UnixNano(), rand.Uint64(), n.hostname)
wheren.hostname
isos.Hostname
and fallback tolocalhost.localdomain
Notable differences:
- SendResolved is
false
to
andfrom
should be parseable byParseAddressList
fromnet/mail
which accepts only comma-separated
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:
- Grafana Email receiver is a very different than Alertamanager's mostly because it re-uses Grafana infrastructure for sending emails.
- The email body templating is two-stage: the first stage in the notifier expands the template of the message and subject using a template common for all notifiers. At this stage, the user is not allowed to render HTML code. The second stage embeds the expanded data in the HTML template.
from alerting.
Related Issues (20)
- Allow customization of Slack thread message (for images)
- Alertmanager peerReconnectTimeout config HOT 1
- Dummy 'summary' message for Pagerduty integration discussion
- ValueString in Grafana 10 HOT 1
- Update Google Hangouts to Google Chat
- Include screenshot URL to Telegram message HOT 3
- Slack mentions should check length of the rendered template instead of the template source HOT 1
- Alert fires twice with two different image URLs when enabling Azure storage HOT 2
- Webhook Receiver should support custom headers HOT 2
- Support for slack mrkdwn HOT 1
- Alert notifications are lost when grafana restarts HOT 1
- Implementing streaming mode for kafka plugin HOT 1
- Templating: allow to transform json text to object HOT 1
- Add Amazon SNS as receiver
- Templating : Add URL buttons HOT 3
- Pending period in the Grafana UI is bound to the wrong value HOT 2
- Slack workflow webhook always results in "failed to send Slack message: unexpected empty response" HOT 2
- Integrate gops labels in alerting
- Truncating Telegram HTML/Markdown alerts returns 400 HOT 2
- [Feature Request] add more alerting "default" templates
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alerting.