Lodol Docs

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

ParameterTypeRequiredDescription
dashboard_uidstringYesID of the dashboard to add the annotation to
textstringYesThe text to show in the annotation
tagsarrayNoList of tags for the annotation
timenumberNoWhen 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

ParameterTypeRequiredDescription
uidstringYesUnique 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

ParameterTypeRequiredDescription
activebooleanNoInclude alerts that are currently firing. Defaults to true
silencedbooleanNoInclude alerts that have been silenced (muted). Defaults to true
inhibitedbooleanNoInclude 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

ParameterTypeRequiredDescription
querystringNoWhat to search for; matches dashboard titles and tags
limitnumberNoMaximum number of dashboards to return

Response

{
  "dashboards": [
    {
      "title": "System Metrics",
      "type": "dash-db",
      "uid": "abc123xyz",
      "uri": "db/system-metrics",
      "url": "/d/abc123xyz/system-metrics"
    }
  ]
}

On this page