forked from idealista/prom2teams
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request idealista#352 from idealista/develop
Release
- Loading branch information
Showing
18 changed files
with
1,168 additions
and
579 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,6 @@ os: linux | |
dist: bionic | ||
language: python | ||
|
||
dist: focal | ||
|
||
services: | ||
- docker | ||
|
||
|
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
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
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
Oops, something went wrong.