oncall-engine/engine/config_integrations/webhook.py

60 lines
1.3 KiB
Python
Raw Permalink Normal View History

# Main
enabled = True
title = "Webhook"
slug = "webhook"
short_description = "If your monitoring system isn't listed, choose Webhook for generic templates, and feel free to modify them as needed."
description = None
is_featured = True
featured_tag_name = "Generic"
is_displayed_on_web = True
is_able_to_autoresolve = True
is_demo_alert_enabled = True
# Default templates
slack_title = """\
*<{{ grafana_oncall_link }}|#{{ grafana_oncall_incident_id }} Incident>* via {{ integration_name }}
{% if source_link %}
(*<{{ source_link }}|source>*)
{%- endif %}
"""
slack_message = "```{{ payload|tojson_pretty }}```"
slack_image_url = None
web_title = "Incident"
web_message = """\
```
{{ payload|tojson_pretty }}
```
"""
web_image_url = slack_image_url
sms_title = web_title
phone_call_title = sms_title
telegram_title = sms_title
telegram_message = "<code>{{ payload|tojson_pretty }}</code>"
telegram_image_url = slack_image_url
source_link = "{{ payload.url }}"
grouping_id = """\
{% if "is_oncall_heartbeat" in payload %}
{# Case for heartbeat alerts generated by Grafana OnCall #}
{{- payload.alert_uid }}
{% else %}
{{- payload }}
{% endif %}"""
resolve_condition = """{{ payload.get("state", "").upper() == "OK" }}"""
acknowledge_condition = None
example_payload = {"message": "This alert was sent by user for demonstration purposes"}