Skip to content

kr7shnasomani/kairos / .agents/skills/grafana-oss

grafana-oss

Flagged

Configure Grafana OSS — provisions dashboards from YAML, sets up data sources (Prometheus / Loki / Tempo / Pyroscope), writes dashboard JSON with template variables, builds panel queries, assigns built-in roles (Viewer / Editor / Admin / GrafanaAdmin), mints service-account tokens, edits grafana.ini server config, creates annotations, installs plugins via provisioning, and validates each step with a health-check curl. Use when building dashboards, configuring data sources, setting up provisioning YAML, picking a panel type, writing template variables, managing users and roles, configuring SMTP/OAuth in grafana.ini, creating annotations via API, troubleshooting why a provisioned dashboard isn't showing up, or running Grafana OSS locally — even when the user says "set up a Prometheus data source", "provision dashboards from git", "make a service account", or "configure SSO in OSS" without saying "Grafana OSS".

FileKindSize
SKILL.mdskill md5.4 KB
references/alerting.mdmarkdown11.2 KB
references/api.mdmarkdown2.7 KB
references/config.mdmarkdown2.3 KB
references/dashboard-json.mdmarkdown2.1 KB
references/dashboards.mdmarkdown6.1 KB
references/datasources.mdmarkdown9.8 KB
references/panel-types.mdmarkdown1.2 KB
references/panels.mdmarkdown10.3 KB

references/api.md

View on GitHub
# Grafana OSS API

Base URL: `https://your-grafana.example.com/api/`. Auth: service account token (`Authorization: Bearer <token>`).

## Contents

- [Dashboards](#dashboards)
- [Data sources](#data-sources)
- [Users + service accounts](#users--service-accounts)
- [Annotations](#annotations)

## Dashboards

```bash
# Search
GET /api/search?query=service&type=dash-db&folderIds=1

# Get by UID
GET /api/dashboards/uid/{uid}

# Create / update (overwrite: true replaces existing)
POST /api/dashboards/db
Body: { "dashboard": {...}, "folderUID": "...", "overwrite": true }

# Delete
DELETE /api/dashboards/uid/{uid}
```

After provisioning a dashboard via YAML, verify it landed:
```bash
curl https://grafana.example.com/api/dashboards/uid/<uid> \
  -H "Authorization: Bearer <token>" | jq '.dashboard.title'
# Should print the dashboard's title. 404 = not provisioned correctly.
```

## Data sources

```bash
# List
GET /api/datasources

# Get by UID
GET /api/datasources/uid/{uid}

# Create
POST /api/datasources
Body: { "name": "...", "type": "...", "url": "...", "access": "proxy" }

# Health-check (good post-provision validation)
GET /api/datasources/uid/{uid}/health
# Returns { "status": "OK" | "ERROR", "message": "..." }
```

## Users + service accounts

```bash
# List org users
GET /api/org/users

# List service accounts
GET /api/serviceaccounts/search?perpage=100&page=1

# Create service account
POST /api/serviceaccounts
Body: { "name": "ci-reader", "role": "Viewer", "isDisabled": false }

# Mint a token
POST /api/serviceaccounts/{id}/tokens
Body: { "name": "ci-token", "secondsToLive": 0 }   # 0 = no expiry

# Verify a token works
curl https://grafana.example.com/api/org \
  -H "Authorization: Bearer <new-token>"
# 200 + org JSON = token + role assignment work.
```

## Annotations

```bash
# Create
curl -X POST https://grafana.example.com/api/annotations \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "dashboardUID": "service-overview",
    "panelId": 1,
    "time": 1706745600000,
    "timeEnd": 1706749200000,
    "tags": ["deploy", "v2.0"],
    "text": "Deployed v2.0"
  }'

# Find (by tag)
GET /api/annotations?tags=deploy&from=1706745600000&to=1706832000000

# Delete
DELETE /api/annotations/{id}
```

## Common failure modes

| Symptom | Likely cause |
|---|---|
| `401 Unauthorized` | Token expired or wrong stack URL — check the Authorization header |
| `403 Forbidden` on dashboard create | Service account lacks Editor role on the target folder |
| `412 Precondition Failed` on POST `/dashboards/db` | UID exists and you didn't set `overwrite: true` |
| Data source health check `ERROR` | Network unreachable (check `url` field) or credentials wrong |
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall