01README
@keeb/grafana
Swamp extension for Grafana dashboard and alert management via the Grafana HTTP API.
Models
grafana/instance
Manage dashboards, alert rules, contact points, and notification policies on a Grafana instance.
| Method | Description |
|---|---|
discover |
List all dashboards |
pushDashboard |
Create or update a dashboard from a JSON file |
exportDashboard |
Export a dashboard to JSON |
configureContactPoint |
Configure a notification contact point (e.g. Discord webhook) |
configureNotificationPolicy |
Set the notification routing policy |
pushAlertRule |
Create or update an alert rule |
createAnnotation |
Create a dashboard annotation (used to mark deploys, server events) |
Workflows
None — dashboard and alert deployment workflows are defined in the consuming project.
Dependencies
- @keeb/ssh — SSH helpers (
lib/ssh.ts)
Install
swamp extension pull @keeb/grafanaExample
Push a dashboard JSON file and create a deploy annotation:
models:
- name: grafana
type: "@keeb/grafana/instance"
globalArguments:
grafanaUrl: "http://grafana.local:3000"
apiKey: "${vault.grafana.apiKey}"
jobs:
- name: push-and-annotate
steps:
- model: grafana
method: pushDashboard
inputs:
dashboardFile: "dashboards/hosts.json"
- model: grafana
method: createAnnotation
inputs:
text: "deploy ${env.GIT_SHA}"
tags: '["deploy"]'License
MIT
02Models
@keeb/grafana/instancev2026.03.05.1grafana_instance.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| grafanaUrl | string | Grafana URL (e.g., http://grafana.treehouse.local) |
| apiKey? | string | Grafana API key for authentication (optional) |
fn discover()
Validate Grafana is running, list dashboards and datasources
fn pushDashboard(dashboardFile: string)
Read dashboard JSON from repo and push to Grafana
| Argument | Type | Description |
|---|---|---|
| dashboardFile | string | Path to dashboard JSON relative to repo root |
fn exportDashboard(dashboardUid: string, outputFile: string)
Export a dashboard from Grafana to a local JSON file
| Argument | Type | Description |
|---|---|---|
| dashboardUid | string | UID of the dashboard to export |
| outputFile | string | Output file path relative to repo root |
fn getDashboard(dashboardUid: string)
Fetch a dashboard from Grafana and store its full content (panels, variables, etc.)
| Argument | Type | Description |
|---|---|---|
| dashboardUid | string | UID of the dashboard to fetch |
fn configureContactPoint(webhookUrl: string, name?: string)
Create or update a Discord webhook contact point in Grafana
| Argument | Type | Description |
|---|---|---|
| webhookUrl | string | Discord webhook URL |
| name? | string | Contact point name |
fn configureNotificationPolicy(contactPointName?: string)
Set the default notification policy to route to a contact point
| Argument | Type | Description |
|---|---|---|
| contactPointName? | string | Contact point receiver name |
fn pushAlertRule(ruleFile: string)
Read alert rule JSON from repo and push to Grafana
| Argument | Type | Description |
|---|---|---|
| ruleFile | string | Path to alert rule JSON relative to repo root |
fn createAnnotation(text: string, tags?: string, dashboardUid?: string)
Create a Grafana annotation (global or scoped to a dashboard)
| Argument | Type | Description |
|---|---|---|
| text | string | Annotation text |
| tags? | string | JSON array of annotation tags |
| dashboardUid? | string | Optional dashboard UID to scope annotation |
fn queryMetrics(query: string, start?: string, end?: string, step?: string)
Query Prometheus metrics via Grafana datasource proxy
| Argument | Type | Description |
|---|---|---|
| query | string | PromQL query string |
| start? | string | Range start time (ISO8601 or relative like '24h') |
| end? | string | Range end time (ISO8601, defaults to now) |
| step? | string | Query step interval |
03Skills
grafana3 files
Claude Code skill for managing Grafana dashboards, alerts, and annotations.
04Previous Versions
2026.04.15.1Apr 15, 2026
Modified 1 models
2026.04.02.1Apr 2, 2026
Modified 1 models
2026.03.18.2Mar 18, 2026
Modified 1 models
2026.03.05.1Mar 5, 2026
05Stats
A
100 / 100
Downloads
30
Archive size
80.0 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types1/1earned
- Has description1/1earned
- At least one platform tag (or universal)1/1earned
- Two or more platform tags (or universal)1/1earned
- License declared1/1earned
- Verified public repository2/2earned
Repository
https://github.com/keeb/swamp-grafana06Security Notice
This extension includes AI agent skills that can modify AI assistant behavior. Review the skill files before installing.
07Platforms
08Labels