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 | UID of the dashboard to annotate |
text | string | Yes | Annotation text content |
tags | array | No | List of tags for the annotation |
time | number | No | Epoch timestamp in milliseconds for the annotation |
Response
{
"id": 42,
"message": "Annotation added"
}Get dashboard
Retrieve details of a specific Grafana dashboard by UID.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
uid | string | Yes | Unique identifier of the dashboard |
Response
{
"tags": [
"infrastructure",
"monitoring"
],
"title": "System Metrics",
"uid": "abc123xyz",
"url": "/d/abc123xyz/system-metrics"
}List alerts
List alerts from Grafana Alertmanager.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
active | boolean | No | Show active alerts (default true) |
silenced | boolean | No | Show silenced alerts (default true) |
inhibited | boolean | No | Show inhibited alerts (default 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 query string.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | No | Search query to filter dashboards by title or tag |
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"
}
]
}