Grafana

From BuilderIO/agent-native · View interactive version

Grafana is an AI agent skill from the GitHub repository BuilderIO/agent-native. Query Grafana dashboards and Prometheus metrics for service health, LLM latency, and infrastructure monitoring. Use this skill when the user asks about service health, monitoring, alerts, or performance metrics.

How to use this skill

Skill file

Grafana Integration

Connection

Server Lib & API Routes

Exported Functions

| Function | Description |

| --------------------------------------------- | --------------------------------------- |

| listDashboards(query?) | Search dashboards by query |

| getDashboard(uid) | Full dashboard JSON with panels |

| getDatasources() | List all datasources |

| getAlertRules() | All alert rules (flattened from groups) |

| getAlertInstances() | Currently firing alert instances |

| queryDatasource(uid, queries[], from?, to?) | Proxy to Grafana's /api/ds/query |

API Routes

| Route | Description |

| ------------------------------------ | ----------------------------------------- |

| GET /api/grafana/dashboards | Search dashboards |

| GET /api/grafana/dashboard?uid=... | Full dashboard JSON |

| GET /api/grafana/datasources | List datasources |

| GET /api/grafana/alerts | Alert rules and firing instances |

| POST /api/grafana/query | Query datasource (Prometheus, Loki, etc.) |

Agent Action

Use grafana for agent-facing Grafana work. Do not call /api/grafana/*

directly from the agent.

| Mode | Args | Description |

| ------------- | ---------------------------------------- | -------------------------------- |

| dashboards | search | Search dashboards |

| dashboard | uid | Full dashboard JSON |

| datasources | | List datasources |

| alerts | | Alert rules and firing instances |

| query | datasourceUid, queries, from, to | Query a datasource |

Dashboard

Grafana Response Frame Format

{ results: { [refId]: { frames: [{ schema: { fields }, data: { values } }] } } }

Template Variables

Key Prometheus Metrics

Key Patterns & Gotchas

Incident Investigation Pattern

For production issues, query Grafana/Prometheus FIRST:

  1. LLM latency by model (llm_latency_bucket)
  2. Request rates (api_request_total)
  3. Error rates (llm_failures_total)
  4. Instance counts (via Cloud Monitoring)

Then check Agent-Native Analytics Monitoring -> Errors for captured application

issues, external Sentry when connected, and Cloud Logging for raw logs.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.