Grafana
API actions for the Grafana integration.
Grafana
Visualize metrics, explore logs, and annotate incidents with Grafana.
Create annotation
Create an annotation on a Grafana dashboard to mark events.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
dashboard_uid | string | Yes | ID of the dashboard to add the annotation to |
text | string | Yes | The text to show in the annotation |
tags | array | No | List of tags for the annotation |
time | number | No | When the event happened, in milliseconds since January 1, 1970 (for example, 1750000000000) |
Response
{
"id": 42,
"message": "Annotation added"
}Get dashboard
Look up the details of a Grafana dashboard using its ID.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
uid | string | Yes | Unique ID of the dashboard (for example, abc123xyz) |
Response
{
"tags": [
"infrastructure",
"monitoring"
],
"title": "System Metrics",
"uid": "abc123xyz",
"url": "/d/abc123xyz/system-metrics"
}List alerts
List alerts from Grafana's alerting system (Alertmanager).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
active | boolean | No | Include alerts that are currently firing. Defaults to true |
silenced | boolean | No | Include alerts that have been silenced (muted). Defaults to true |
inhibited | boolean | No | Include alerts that are hidden because a related alert is already firing (inhibited). Defaults to true |
Response
{
"alerts": [
{
"labels": {
"alertname": "HighCPUUsage",
"severity": "warning"
},
"name": "HighCPUUsage",
"startsAt": "2024-01-15T10:30:00Z",
"state": "active"
}
]
}Search dashboards
Search for Grafana dashboards by title or tag.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | No | What to search for; matches dashboard titles and tags |
limit | number | No | Maximum number of dashboards to return |
Response
{
"dashboards": [
{
"title": "System Metrics",
"type": "dash-db",
"uid": "abc123xyz",
"uri": "db/system-metrics",
"url": "/d/abc123xyz/system-metrics"
}
]
}