Integrate Spike with OpsPilot
Send OpsPilot (formerly FusionReactor Cloud) alerts to Spike so a firing alert reaches your on-call team, and the incident closes when it recovers.
Overview
OpsPilot (formerly FusionReactor Cloud) monitors your FusionReactor instances and applications. Alert rules watch a metric, and when a rule fires OpsPilot notifies the contact points the rule names or its notification policy routes to.
A Webhook contact point posts each notification to Spike as JSON. A firing alert opens an incident and pages your escalation policy. A repeat of the same alert joins the incident that is already open, and the recovery resolves it.
How Spike identifies an alert
Spike identifies the incident by the notification's top-level groupKey, which names one alert group. A firing notification opens an incident or joins the open one with the same groupKey, and the resolved notification for that group closes it, even when the readings in the summary have changed.
groupKeycounts as an id only when it is a non-empty string (after trimming) or a number. Spike matches it as sent, ignoring surrounding spaces and whether it arrives as a number or text.A
groupKeythat is a template variable that was never filled in, such as$groupKey,${groupKey}or{{ .GroupKey }}, counts as no id.If there is no usable
groupKey, Spike can only match by incident title. The title is then always the plain<alertname> on <where>with no sentence and no readings, so it is identical at firing and at recovery.A top-level
statusofresolved(trimmed, case-insensitive) only closes an incident and never opens one. Any other value opens an incident.stateis not read.In a batch, alerts whose own
statusisresolvedare not counted.
Incident title
The title is the sentence you set in the contact point's Message setting (see Step 2), with whitespace collapsed and capped at 200 characters:
CPU usage on app-prod-02 is 96.4%, above the 90% thresholdIf Message is empty, or is still Grafana's default multi-line template (it starts with **Firing** or **Resolved**, or has Labels:, Annotations: or Source: http lines), Spike falls back in this order:
When more than one alert is firing:
2 alerts in Production: High CPU usage, Low disk space. The batch title wins over any alert's summary. It names at most two alerts and adds+K morefor the rest.The first alert's
annotations.summaryThe first alert's
annotations.description<alertname> on <where>, for exampleHigh CPU usage on app-prod-02. The place is the first alert'sinstancelabel, then itsgrafana_folderlabel.OpsPilot alert with no detailswhen nothing is usable.
{{ .CommonAnnotations.summary }} renders empty when the alerts in one notification have different summaries, for example several hosts each reporting their own reading. Message is then empty, so a notification with more than one firing alert gets the batch title from item 1.
Every title is capped at 200 characters, however long the values in it are.
A recovery is titled <alertname> on <where> resolved. Spike resolves by groupKey, so this title may differ from the one the incident opened with. The readings in values never appear in a title.
Use a Title Remapper if you want a different title.
Prerequisites
An OpsPilot account that can create contact points and alert rules or notification policies
An OpsPilot integration in Spike and its webhook URL
Outbound HTTPS from OpsPilot to
hooks.spike.sh
Set up instructions
Step 1: Add the OpsPilot integration in Spike and copy the webhook URL.
Create integration and service on our dashboardStep 2: Create the webhook contact point in OpsPilot.
Open contact points: In OpsPilot, go to Alerting > Notifications and open the Contact Points tab.
Choose Webhook: Click + New contact point to open the integration picker, open the Webhook category tab and select Webhook.
Paste the Spike URL (required): Paste the webhook URL from Step 1 into the webhook URL field, and enter a unique, descriptive Name such as
Spike.Set the Message, if your form shows it (strongly recommended): OpsPilot's alerting is built on Grafana, and Grafana's Webhook form has a Message setting (under Optional Webhook settings). OpsPilot's documentation does not describe the Webhook form's fields, so if your form has Message, set it to:
This becomes the incident title. Without it, Spike falls back to the rule's summary annotation, so add a summary annotation to each alert rule. If the form also shows an HTTP Method setting, leave it at POST.
Leave authorization empty: The token in the URL is the credential. Treat the URL like a password.
Save: Click Save contact point. If your form has a Test button, use it to send a test notification to Spike.
Route alerts to it: Either pick the contact point on the alert rule itself: under Then notify, click + Add contact point and choose
Spike. Or route through a notification policy: go to Alerting > Notifications, open the Notification Policy tab, click + New route, choose theSpikecontact point and add a matcher, such as achannellabel that your alert rules carry. Make sure the alert rules you route carry summary and description annotations, and that the route does not group on labels that differ between alerts you want in one incident.
What OpsPilot sends
OpsPilot does not document its webhook body. Its alerting is built on Grafana, so the webhook contact point is expected to send Grafana's documented webhook body. The bodies below are examples in that format, not captured OpsPilot notifications, and the hostnames in them are placeholders. Spike reads only the fields in this table. groupKey, status and alerts[].status are the ones that open and resolve incidents.
message
The incident title, when it is a usable sentence
status
firing opens or joins an incident, resolved closes it and never opens one
groupKey
The identity of the alert group, used to join repeats and to resolve
alerts
The grouped alert instances. The number of alerts not marked resolved is the batch count
alerts[].status
firing or resolved for each alert. In a batch, resolved alerts are not counted
alerts[].annotations.summary
First title fallback
alerts[].annotations.description
Second title fallback
alerts[].labels.alertname
The rule name in <alertname> on <where> and in batch titles
alerts[].labels.instance
The host the alert is about, first choice for <where>
alerts[].labels.grafana_folder
<where> when there is no instance, and the group name in a batch title
Repeats that change only message, title, commonAnnotations.summary or commonAnnotations.description join the open incident.
Firing example
Recovery example
The same alert group with the same groupKey, once it has recovered. Spike resolves the open incident and titles the recovery High CPU usage on app-prod-02 resolved:
Troubleshooting
The title is a rule name, not a sentence. Message is empty or still the default template, and the rule has no
summaryordescriptionannotation. Set Message as in Step 2 or add asummaryannotation to the rule.Repeats open new incidents. Check that the payload carries a non-empty
groupKeythat is not an unfilled template variable such as{{ .GroupKey }}. Without one Spike matches by title.The incident does not resolve. Check that the contact point sends resolved notifications (if your form has Grafana's Disable resolved message setting, leave it off) and that the resolved notification carries the same
groupKeyas the firing one. OpsPilot's documentation does not say whether resolved notifications are sent.
Last updated

