# Observability Grafana

> Grafana dashboard and metrics analysis. Use when querying dashboards, panels, Prometheus metrics via Grafana, checking datasources, reviewing alerts, or creating dashboards from templates.

- **Type:** Skill
- **Install:** `agentstack add skill-swapnildahiphale-opensre-observability-grafana`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [swapnildahiphale](https://agentstack.voostack.com/s/swapnildahiphale)
- **Installs:** 0
- **Category:** [Cloud & Infrastructure](https://agentstack.voostack.com/c/cloud-infrastructure)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [swapnildahiphale](https://github.com/swapnildahiphale)
- **Source:** https://github.com/swapnildahiphale/OpenSRE/tree/main/sre-agent/.claude/skills/observability-grafana
- **Website:** https://opensre.in

## Install

```sh
agentstack add skill-swapnildahiphale-opensre-observability-grafana
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Grafana Dashboard Analysis

## Authentication

**IMPORTANT**: Credentials are injected automatically by a proxy layer. Do NOT check for `GRAFANA_API_KEY` in environment variables - it won't be visible to you. Just run the scripts directly; authentication is handled transparently.

Configuration environment variables you CAN check (non-secret):
- `GRAFANA_URL` - Grafana instance URL (e.g., `https://grafana.company.com`)

---

## Available Scripts

All scripts are in `.claude/skills/observability-grafana/scripts/`

### list_dashboards.py - Search/List Dashboards
```bash
python .claude/skills/observability-grafana/scripts/list_dashboards.py [--query "kubernetes"]
```

### get_dashboard.py - Get Dashboard Details
```bash
python .claude/skills/observability-grafana/scripts/get_dashboard.py --uid DASHBOARD_UID
```

### query_prometheus.py - Query Prometheus via Grafana
```bash
python .claude/skills/observability-grafana/scripts/query_prometheus.py --query "PROMQL" [--time-range 60] [--step 1m] [--datasource-id ID]

# Examples (auto-detects Prometheus datasource):
python .claude/skills/observability-grafana/scripts/query_prometheus.py --query "rate(http_requests_total[5m])"
python .claude/skills/observability-grafana/scripts/query_prometheus.py --query "up{job='api'}" --time-range 120

# Explicit datasource ID (use list_datasources.py to find it):
python .claude/skills/observability-grafana/scripts/query_prometheus.py --query "up" --datasource-id 8
```
**Note**: The Prometheus datasource ID is auto-detected by default. Use `list_datasources.py` if you need to target a specific datasource.

### list_datasources.py - List Configured Datasources
```bash
python .claude/skills/observability-grafana/scripts/list_datasources.py
```

### get_alerts.py - Get Active Alerts
```bash
python .claude/skills/observability-grafana/scripts/get_alerts.py
```

### create_dashboard.py - Create Dashboard from Template
```bash
python .claude/skills/observability-grafana/scripts/create_dashboard.py \
  --title "My Dashboard" \
  --template .claude/skills/observability-grafana/templates/vercel-overview.json

# With folder:
python .claude/skills/observability-grafana/scripts/create_dashboard.py \
  --title "My Dashboard" \
  --template .claude/skills/observability-grafana/templates/vercel-overview.json \
  --folder-uid FOLDER_UID

# Overwrite existing:
python .claude/skills/observability-grafana/scripts/create_dashboard.py \
  --title "My Dashboard" \
  --template .claude/skills/observability-grafana/templates/vercel-overview.json \
  --overwrite
```

---

## Dashboard Templates

Pre-built templates are in `.claude/skills/observability-grafana/templates/`:

| Template | Description |
|----------|-------------|
| `vercel-overview.json` | 4-panel Vercel monitoring: error count, error rate, log stream, request summary |

---

## PromQL Quick Reference

```promql
# Request rate
rate(http_requests_total{service="api"}[5m])

# Error rate %
sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m])) * 100

# P95 latency
histogram_quantile(0.95, rate(http_duration_seconds_bucket{service="api"}[5m]))

# CPU usage
rate(process_cpu_seconds_total{service="api"}[5m])
```

---

## Investigation Workflow

```
1. list_datasources.py                    # Find available datasources
2. list_dashboards.py --query "api"       # Find relevant dashboards
3. get_dashboard.py --uid            # Get dashboard details
4. query_prometheus.py --query "rate(http_requests_total{service='api',status=~'5..'}[5m])"
5. get_alerts.py                          # Check active alerts
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [swapnildahiphale](https://github.com/swapnildahiphale)
- **Source:** [swapnildahiphale/OpenSRE](https://github.com/swapnildahiphale/OpenSRE)
- **License:** Apache-2.0
- **Homepage:** https://opensre.in

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-swapnildahiphale-opensre-observability-grafana
- Seller: https://agentstack.voostack.com/s/swapnildahiphale
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
