-
Notifications
You must be signed in to change notification settings - Fork 89
/
teams.j2
71 lines (71 loc) · 2.57 KB
/
teams.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.4",
"msteams": {
"width": "Full"
},
"body": [
{
"type": "ColumnSet",
"style": "{% if status=='resolved' %}good{% else %}attention{% endif %}",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Prometheus alert {{ msg_text.name }} {% if status=='resolved' %}(Resolved){% elif status=='unknown' %}(status unknown){% else %}triggered{% endif %}",
"weight": "Bolder",
"size": "Large"
},
{
"type": "TextBlock",
"text": "{% if status=='resolved' %}(Resolved) {% endif %}{{ msg_text.summary }}",
"wrap": true
}
]
}
]
},
{
"type": "FactSet",
"facts": [
{% if msg_text.name %} { "title": "Alert", "value": "{{ msg_text.name }}" }, {% endif %}
{% if msg_text.instance %} { "title": "In host", "value": "{{ msg_text.instance }}" }, {% endif %}
{% if msg_text.severity %} { "title": "Severity", "value": "{{ msg_text.severity }}" }, {% endif %}
{% if msg_text.description %} { "title": "Description", "value": "{{ msg_text.description }}" }, {% endif %}
{ "title": "Status", "value": "{{ msg_text.status }}" }
{% if msg_text.extra_labels %}
{% for key in msg_text.extra_labels %}
, { "title": "{{ key }}", "value": "{{ msg_text.extra_labels[key] }}" }
{% endfor %}
{% endif %}
{% if msg_text.extra_annotations %}
{% for key in msg_text.extra_annotations %}
, { "title": "{{ key }}", "value": "{{ msg_text.extra_annotations[key] }}" }
{% endfor %}
{% endif %}
]
}
]
{% if msg_text.runbook_url %}
,
"actions": [
{
"type": "Action.OpenUrl",
"title": "View details",
"url": "{{ msg_text.runbook_url }}"
}
]
{% endif %}
}
}
]
}