-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
baba861
commit aab1a95
Showing
14 changed files
with
1,150 additions
and
577 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,71 @@ | ||
{%- set | ||
theme_colors = { | ||
'resolved' : '2DC72D', | ||
'critical' : '8C1A1A', | ||
'severe' : '8C1A1A', | ||
'warning' : 'FF9A0B', | ||
'unknown' : 'CCCCCC' | ||
} | ||
-%} | ||
|
||
{ | ||
"@type": "MessageCard", | ||
"@context": "http://schema.org/extensions", | ||
"themeColor": "{% if status=='resolved' %} {{ theme_colors.resolved }} {% else %} {{ theme_colors[msg_text.severity] }} {% endif %}", | ||
"summary": "{% if status=='resolved' %}(Resolved) {% endif %}{{ msg_text.summary }}", | ||
"title": "Prometheus alert {% if status=='resolved' %}(Resolved) {% elif status=='unknown' %} (status unknown) {% endif %}", | ||
"sections": [{ | ||
"activityTitle": "{{ msg_text.summary }}", | ||
"facts": [{% if msg_text.name %}{ | ||
"name": "Alert", | ||
"value": "{{ msg_text.name }}" | ||
},{% endif %}{% if msg_text.instance %}{ | ||
"name": "In host", | ||
"value": "{{ msg_text.instance }}" | ||
},{% endif %}{% if msg_text.severity %}{ | ||
"name": "Severity", | ||
"value": "{{ msg_text.severity }}" | ||
},{% endif %}{% if msg_text.description %}{ | ||
"name": "Description", | ||
"value": "{{ msg_text.description }}" | ||
},{% endif %}{ | ||
"name": "Status", | ||
"value": "{{ msg_text.status }}" | ||
}{% if msg_text.extra_labels %}{% for key in msg_text.extra_labels %},{ | ||
"name": "{{ key }}", | ||
"value": "{{ msg_text.extra_labels[key] }}" | ||
}{% endfor %}{% endif %} | ||
{% if msg_text.extra_annotations %}{% for key in msg_text.extra_annotations %},{ | ||
"name": "{{ key }}", | ||
"value": "{{ msg_text.extra_annotations[key] }}" | ||
}{% endfor %}{% endif %}], | ||
"markdown": true | ||
}] | ||
} | ||
"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 %} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,71 @@ | ||
{%- set | ||
theme_colors = { | ||
'resolved' : '2DC72D', | ||
'critical' : '8C1A1A', | ||
'severe' : '8C1A1A', | ||
'warning' : 'FF9A0B', | ||
'unknown' : 'CCCCCC' | ||
} | ||
-%} | ||
|
||
{ | ||
"@type": "MessageCard", | ||
"@context": "http://schema.org/extensions", | ||
"themeColor": "{% if status=='resolved' %} {{ theme_colors.resolved }} {% else %} {{ theme_colors[msg_text.severity] }} {% endif %}", | ||
"summary": "{% if status=='resolved' %}(Resolved) {% endif %}{{ msg_text.summary }}", | ||
"title": "Prometheus alert {% if status=='resolved' %}(Resolved) {% elif status=='unknown' %} (status unknown) {% endif %}", | ||
"sections": [{ | ||
"activityTitle": "{{ msg_text.summary }}", | ||
"facts": [{% if msg_text.name %}{ | ||
"name": "Alert", | ||
"value": "{{ msg_text.name }}" | ||
},{% endif %}{% if msg_text.instance %}{ | ||
"name": "In host", | ||
"value": "{{ msg_text.instance }}" | ||
},{% endif %}{% if msg_text.severity %}{ | ||
"name": "Severity", | ||
"value": "{{ msg_text.severity }}" | ||
},{% endif %}{% if msg_text.description %}{ | ||
"name": "Description", | ||
"value": "{{ msg_text.description }}" | ||
},{% endif %}{ | ||
"name": "Status", | ||
"value": "{{ msg_text.status }}" | ||
}{% if msg_text.extra_labels %}{% for key in msg_text.extra_labels %},{ | ||
"name": "{{ key }}", | ||
"value": "{{ msg_text.extra_labels[key] }}" | ||
}{% endfor %}{% endif %} | ||
{% if msg_text.extra_annotations %}{% for key in msg_text.extra_annotations %},{ | ||
"name": "{{ key }}", | ||
"value": "{{ msg_text.extra_annotations[key] }}" | ||
}{% endfor %}{% endif %}], | ||
"markdown": true | ||
}] | ||
{% if msg_text.runbook_url %} | ||
, | ||
"potentialAction": [ | ||
{ | ||
"@context": "http://schema.org", | ||
"@type": "ViewAction", | ||
"name": "Runbook", | ||
"target": [ | ||
"{{ msg_text.runbook_url }}" | ||
"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 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
{% endif %} | ||
} | ||
}, | ||
{ | ||
"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 %} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,54 @@ | ||
{ | ||
"@type": "MessageCard", | ||
"@context": "http://schema.org/extensions", | ||
"themeColor": " 2DC72D ", | ||
"summary": "(Resolved) Disk usage alert on CS30.evilcorp", | ||
"title": "Prometheus alert (Resolved) ", | ||
"sections": [{ | ||
"activityTitle": "Disk usage alert on CS30.evilcorp", | ||
"facts": [{ | ||
"name": "Alert", | ||
"value": "DiskSpace" | ||
},{ | ||
"name": "In host", | ||
"value": "cs30.evilcorp" | ||
},{ | ||
"name": "Severity", | ||
"value": "severe" | ||
},{ | ||
"name": "Description", | ||
"value": "disk usage 93% on rootfs device" | ||
},{ | ||
"name": "Status", | ||
"value": "resolved" | ||
}], | ||
"markdown": true | ||
}] | ||
"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": "good", | ||
"columns": [ | ||
{ | ||
"type": "Column", | ||
"width": "stretch", | ||
"items": [ | ||
{ | ||
"type": "TextBlock", | ||
"text": "Prometheus alert DiskSpace (Resolved)", | ||
"weight": "Bolder", | ||
"size": "Large" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "(Resolved) Disk usage alert on CS30.evilcorp", | ||
"wrap": true | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "FactSet", | ||
"facts": [ | ||
{ "title": "Alert", "value": "DiskSpace" }, | ||
{ "title": "In host", "value": "cs30.evilcorp" }, | ||
{ "title": "Severity", "value": "severe" }, | ||
{ | ||
"title": "Description", | ||
"value": "disk usage 93% on rootfs device" | ||
}, | ||
{ "title": "Status", "value": "resolved" } | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.