incident.io
To integrate groundcover with incident.io, follow the steps below. Note that you’ll need a Pro incident.io account to view your incoming alerts.
Generate an Alerts configuration for groundcover Log in to your incident.io account. Go to "Alerts" -> "Configuration" and add a new configuration.
On the alert source screen of the configuration the answer to the question "Where do your alerts come from?" should be "HTTP". Select this source and give it a unique name. Hit "continue".
incident.io will create your configuration now from which you will need to copy the following items for the Webhook integration
Set Up the Webhook in groundcover
Head out to the integrations section: Settings -> Integrations, to create a new Webhook
Start by giving your Webhook integration a name. This name will be used below in the provider block sample .
Set the
Webhook URL
to the url you copied from field (1)Keep the HTTP method as
POST
Under headers add
Authorization
, and paste the "Bearer <token>" copied from field (2).
Create a Workflow Go to
Monitors --> Workflows --> Create Workflow
, and paste the YAML configuration provided below. Note: Thebody
section is a dictionary of keys that will be sent as a JSON payload to the incident.io platformConfigure the
provider
Block In theprovider
block, replace{{ providers.your-incident-io-integration-name }}
with your actual Webhook integration name (the one you created in step 4) For example, if you named your integrationtest-incidentio
, the config reference would be:{{ providers.test-incidentio }}
Required Parameters for Creating an alert When triggering an alert, the following keys are required:
title
- Alert title that can be pulled from groundcover as seen in the examplestatus
- One of "firing" or "resolved" that can also be pulled from groundcover as the example shows.
You can include additional parameters for richer context (optional):
description
deduplication_key
- unique attribute used to group identical alerts, groundcover provides this through the fingerprint attributemetadata
- Any additional metadata that you've configured within your monitor in groundcover. Note that these set should actively reflect your monitor definition in groundcover
Example code for your groundcover workflow:
workflow:
id: webhook
description: Sends an API to incident.io alerts endpoint
triggers:
- type: alert
consts:
description: keep.dictget( {{ alert.annotations }}, "_gc_description", '')
issue: https://app.groundcover.com/monitors/issues?backendId={{ alert.labels.backend_id }}&selectedObjectId={{ alert.fingerprint }}
monitor: https://app.groundcover.com/monitors?backendId={{ alert.labels.backend_id }}&selectedObjectId={{ alert.labels._gc_monitor_id }}
redacted_labels: keep.dict_pop({{alert.labels}}, "_gc_monitor_id", "_gc_monitor_name", "_gc_severity", "backend_id", "grafana_folder", "_gc_issue_header")
silence: https://app.groundcover.com/monitors/create-silence?keep.replace(keep.join({{ consts.redacted_labels }}, "&", "matcher_"), " ", "+")
title: keep.dictget( {{ alert.annotations }}, "_gc_issue_header", "{{ alert.alertname }}")
name: incident-io-alerts-workflow
actions:
- name: webhook
provider:
config: ' {{ providers.your-incident-io-integration-name }} '
type: webhook
with:
body:
title: '{{ alert.alertname }}'
description: '{{ alert.description }}'
deduplication_key: '{{ alert.fingerprint }}'
status: '{{ alert.status }}'
# To use metadata attributes that refer to alert.labels, the attributes
# must be used in the group by section of the monitor - the example below
# assumes that cluster, namespace and workload were used for group by
metadata:
cluster: '{{ alert.labels.cluster }}'
namespace: '{{ alert.labels.namespace }}'
service: '{{ alert.labels.workload }}'
severity: '{{ alert.annotations._gc_severity }}'
Last updated