Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c0685f5
grafana integration base code
mfuzailzubari Feb 6, 2026
bc38d48
fix for grafana visibility in integrations list.
mfuzailzubari Feb 7, 2026
030e33b
fixes for the trigger webhook url + for datashource uid
mfuzailzubari Feb 11, 2026
3f38d38
fix for shared secret + new webhook entry (#1945)
mfuzailzubari Feb 11, 2026
ff634be
Merge branch 'main' into feat/grafana-integration
mfuzailzubari Feb 13, 2026
e424921
fix for Non-constant-time comparison for bearer token authentication
mfuzailzubari Feb 13, 2026
7321e1a
Merge branch 'feat/grafana-integration' of https://github.com/mfuzail…
mfuzailzubari Feb 13, 2026
623a9fa
GetURl unused method removed (#1945)
mfuzailzubari Feb 13, 2026
f4bffe0
jfix(grafana): wrap On Alert Firing example payload (#1945)
mfuzailzubari Feb 13, 2026
214db53
fix(grafana): restore integration icons and unblock dev startup (#1945)
mfuzailzubari Feb 13, 2026
c537535
fix(grafana): allow responses up to max size
mfuzailzubari Feb 13, 2026
11d75be
fix(grafana): enforce absolute baseURL and prevent runtime request fa…
mfuzailzubari Feb 13, 2026
b42c9e5
fix(grafana): align Query Data Source example output with event envel…
mfuzailzubari Feb 13, 2026
e757f7b
Merge branch 'main' into feat/grafana-integration
mfuzailzubari Feb 17, 2026
da0f325
feat(grafana): auto-provision alert webhook contact points with manu…
mfuzailzubari Feb 17, 2026
52e9a74
fix(grafana): guard query mapper when root event data is missing (#1…
mfuzailzubari Feb 17, 2026
703ad3c
fix(grafana): request integration webhook during onAlertFiring setup
mfuzailzubari Feb 17, 2026
96896b9
fix(grafana): move webhook URL display to onAlertFiring custom field …
mfuzailzubari Feb 18, 2026
e5a91a6
fix(grafana): include Triggered At in onAlertFiring details (#1945)
mfuzailzubari Feb 18, 2026
fb0235f
refactor(grafana): unify validation and harden mapper timestamp/detai…
mfuzailzubari Feb 18, 2026
60d6116
fix(grafana): retry transient webhook provisioning failures and mask …
mfuzailzubari Feb 18, 2026
48ba451
fix(grafana): harden webhook secret lifecycle, preserve sharedSecret …
mfuzailzubari Feb 18, 2026
ace715e
fix(grafana): stabilize webhook secret handling (#1945)
mfuzailzubari Feb 18, 2026
61e927d
formatting fixed. (#1945)
mfuzailzubari Feb 18, 2026
8135a08
fix(grafana): run gofmt on client and query data source
mfuzailzubari Feb 18, 2026
81956e0
fix(grafana): harden contact-point parsing and sync generated compon…
mfuzailzubari Feb 18, 2026
6479d8b
fix(grafana): use per-trigger webhook binding and keep contact points…
mfuzailzubari Feb 18, 2026
10a2c39
refactor(grafana-ui): deduplicate mapper helpers into shared utils (#…
mfuzailzubari Feb 18, 2026
d60a172
fix(grafana): use integration-resource datasource field and implement…
mfuzailzubari Feb 19, 2026
fc95056
docs(grafana): update setup instructions for service accounts (with l…
mfuzailzubari Feb 19, 2026
015fd83
fix(grafana-ui): enhance alert setup message box and add webhook URL…
mfuzailzubari Feb 19, 2026
071204a
docs fix + linting (#1945)
mfuzailzubari Feb 19, 2026
e9477c2
fix(grafana): make webhook cleanup no-op without contact point and ga…
mfuzailzubari Feb 19, 2026
a93afd8
fix(grafana): validate webhook context before requesting webhook in …
mfuzailzubari Feb 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions docs/components/Grafana.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
---
title: "Grafana"
---

Connect Grafana alerts and data queries to SuperPlane workflows

## Triggers

<CardGrid>
<LinkCard title="On Alert Firing" href="#on-alert-firing" description="Trigger when a Grafana alert rule is firing" />
</CardGrid>

import { CardGrid, LinkCard } from "@astrojs/starlight/components";

## Actions

<CardGrid>
<LinkCard title="Query Data Source" href="#query-data-source" description="Execute a query against a Grafana data source and return the result" />
</CardGrid>

## Instructions

To connect Grafana:
1. In Grafana, go to Administration > Users and access > Service accounts.
2. Create a Service Account and assign a role (Viewer/Editor/Admin as needed).
3. Open the Service Account and create a token. Copy it immediately.
4. (Legacy Grafana) If Service Accounts are unavailable, use an API key.
5. Set the Base URL to your Grafana instance (e.g. https://grafana.example.com).
6. Paste the token into SuperPlane and save.

For the alert trigger:
1. SuperPlane will attempt to automatically create/update a Grafana Webhook contact point.
2. Route your alert rule to the contact point created by SuperPlane.
3. If auto-provisioning is not available (permissions/API limitations), create a Webhook contact point manually using the webhook URL from SuperPlane.

<a id="on-alert-firing"></a>

## On Alert Firing

The On Alert Firing trigger starts a workflow when Grafana Unified Alerting sends a firing alert webhook.

### Setup

1. SuperPlane attempts to automatically create/update a Grafana Webhook contact point for this trigger.
2. If you set a Shared Secret in this trigger, SuperPlane includes it as an Authorization bearer token in the provisioned contact point.
3. Route your alert rule to the contact point created by SuperPlane.
4. If auto-provisioning is unavailable (permissions/API limitations), create the contact point manually using the webhook URL generated by SuperPlane.
5. For manual setup with Shared Secret, add an HTTP header to the contact point:
- Authorization: Bearer <shared-secret>

### Event Data

The trigger emits the full Grafana webhook payload, including:
- status (firing/resolved)
- alerts array with labels and annotations
- groupLabels, commonLabels, commonAnnotations
- externalURL and other alerting metadata

### Example Data

```json
{
"data": {
"alerts": [
{
"annotations": {
"summary": "Error rate above threshold"
},
"labels": {
"alertname": "HighErrorRate",
"service": "api"
},
"status": "firing"
}
],
"commonLabels": {
"alertname": "HighErrorRate"
},
"externalURL": "http://grafana.local",
"ruleUid": "alert_rule_uid",
"status": "firing",
"title": "High error rate"
},
"timestamp": "2026-02-12T16:18:03.362582388Z",
"type": "grafana.alert.firing"
}
```

<a id="query-data-source"></a>

## Query Data Source

The Query Data Source component executes a query against a Grafana data source using the Grafana Query API.

### Use Cases

- **Metrics investigation**: Run PromQL or other datasource queries from workflows
- **Alert validation**: Validate alert conditions before escalation
- **Incident context**: Pull current metrics into incident workflows

### Configuration

- **Data Source UID**: The Grafana datasource UID to query
- **Query**: The datasource query (PromQL, InfluxQL, etc.)
- **Time From / Time To**: Optional time range (relative like "now-5m" or absolute)
- **Format**: Optional query format (depends on the datasource)

### Output

Returns the Grafana query API response JSON.

### Example Output

```json
{
"data": {
"results": {
"A": {
"frames": [
{
"data": {
"values": [
[
"2026-02-07T08:00:00Z",
"2026-02-07T08:01:00Z"
],
[
1,
1
]
]
},
"schema": {
"fields": [
{
"name": "time",
"type": "time"
},
{
"name": "value",
"type": "number"
}
]
}
}
]
}
}
},
"timestamp": "2026-02-12T16:18:03.362582388Z",
"type": "grafana.query.result"
}
```

Loading