Agent skill

Happy Infra Metrics and Grafana

by slopus in slopus/happy

Queries live Prometheus metrics and manages Grafana dashboards as code for Happy's infrastructure, using the grafanactl CLI and the Grafana datasource proxy API.

MITAuto-check: notesDevOps & Cloud

Install Happy Infra Metrics and Grafana

skills CLI
$ npx skills add slopus/happy --skill metrics-graphana -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install slopus/happy metrics-graphana --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/slopus/happy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/metrics-graphana .claude/skills/metrics-graphana && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
metrics-graphana
GitHub stars
24k
Token cost
~2k tokens
SKILL.md length
422 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

Queries live Prometheus metrics and manages Grafana dashboards as code for Happy's infrastructure, using the grafanactl CLI and the Grafana datasource proxy API.

  • Works in 5 steps: Use the Prometheus datasource: {"type":… → Pick the next available id (check… → Position with gridPos: h = height (8… → …
  • Querying current or historical Prometheus metrics for Happy's infrastructure
  • SKILL.md covers Environment Variables, Prerequisites, grafanactl CLI Reference and Querying Prometheus Directly, plus 3 more sections
  • Calls curl, python3 and go; needs GRAFANA_PASSWORD

What it does

Credentials for Grafana are loaded from a gitignored .env file into the shell before any command runs, and every grafanactl and curl command in the skill references them through environment variables rather than hardcoded values. The grafanactl CLI, installed through Go, lists resource types such as dashboards and folders, pulls dashboards to disk as JSON, and pushes them back to deploy changes, with a documented edit workflow of pulling the current state, editing the JSON, and pushing it back.

A specific warning covers pushing without the omit-manager-fields flag, which marks a dashboard as provisioned and locks it from further UI edits, so that flag is used unless CLI-only management is intended. For live investigation without the Grafana UI, Prometheus can be queried directly through Grafana's datasource proxy API, with separate patterns shown for an instant query and a range query over time.

When your agent uses it

  • Querying current or historical Prometheus metrics for Happy's infrastructure
  • Pulling and editing a Grafana dashboard as code
  • Adding or modifying a dashboard panel

Example prompts

  • “Pull the current state of the API latency dashboard so I can edit it.”
  • “Run a range query for request rate over the last hour through Grafana's proxy.”
  • “Push my updated dashboard JSON without locking it from UI edits.”

Requirements

  • grafanactl (installed via Go)
  • Grafana and Prometheus credentials in a local .env file

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Use the Prometheus datasource: {"type": "prometheus", "uid": "$GRAFANA_PROMETHEUS_UID"}
  2. Pick the next available id (check existing panels for max id)
  3. Position with gridPos: h = height (8 standard), w = width (12 half, 24 full), x = column (0 or 12), y = row
  4. Common panel types: stat, timeseries, piechart, bargauge, table
  5. Set appropriate unit: percentunit, ops, s, short, reqps

What it can do on your machine

Read from SKILL.md and the folder at commit fba320e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl
    • python3
    • go

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use curl, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • GRAFANA_PASSWORD

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Happy Infra Metrics and Grafana loads about 2k tokens when it runs. Until then it costs about 81 tokens; SKILL.md has 422 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~81
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:16
    Credentials are stored in the repo root `.env` file (gitignored). Load them before running commands:
  • NoteMentions a .env fileSKILL.md:27
    set -a; source .env; set +a
  • NoteMentions a .env fileSKILL.md:48
    set -a; source .env; set +a

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from slopus/happy at commit fba320e, republished under its MIT licence (© slopus). 422 words, ~1,985 tokens.

Download SKILL.mdSave it as .claude/skills/metrics-graphana/SKILL.md (or your agent's skills folder).
name
metrics-graphana
description
Query and manage Grafana dashboards and Prometheus metrics for Happy infrastructure. Covers grafanactl CLI usage, direct Prometheus queries through Grafana proxy, and dashboard-as-code workflows. Use when user asks about metrics, dashboards, monitoring, Grafana, Prometheus, or wants to add/modify panels.

Metrics & Grafana

You are the observability operator for the Happy infrastructure. You can query live Prometheus metrics, manage Grafana dashboards as code, and investigate production behavior.

Environment Variables

Credentials are stored in the repo root .env file (gitignored). Load them before running commands:

GRAFANA_URL=...
GRAFANA_USER=...
GRAFANA_PASSWORD=...
GRAFANA_PROMETHEUS_UID=...

To load in shell:

bash
set -a; source .env; set +a

All commands below use $GRAFANA_URL, $GRAFANA_USER, $GRAFANA_PASSWORD, and $GRAFANA_PROMETHEUS_UID from the environment.


Prerequisites

Install grafanactl
bash
go install github.com/grafana/grafanactl/cmd/grafanactl@latest

Ensure $HOME/go/bin is on your PATH.

Configure grafanactl
bash
# Load env vars first
set -a; source .env; set +a

# Create a context for the Happy Grafana instance
grafanactl config set contexts.happy.grafana.server "$GRAFANA_URL"
grafanactl config set contexts.happy.grafana.user "$GRAFANA_USER"
grafanactl config set contexts.happy.grafana.password "$GRAFANA_PASSWORD"
grafanactl config set contexts.happy.grafana.org-id 1

# Switch to the context
grafanactl config use-context happy

# Verify
grafanactl config check

Config file lives at ~/Library/Application Support/grafanactl/config.yaml (macOS) or ~/.config/grafanactl/config.yaml (Linux).


grafanactl CLI Reference

List resources
bash
grafanactl resources list                    # List all resource types
grafanactl resources get dashboards          # List all dashboards
grafanactl resources get folders             # List all folders
Pull dashboards (export to disk)
bash
grafanactl resources pull dashboards -p ./resources -o json
grafanactl resources pull dashboards/DASHBOARD_ID -p ./resources -o json
Push dashboards (deploy from disk)
bash
# Push all dashboards from ./resources
grafanactl resources push dashboards -p ./resources

# Push a specific dashboard
grafanactl resources push dashboards/DASHBOARD_ID -p ./resources

# IMPORTANT: Use --omit-manager-fields to keep dashboards editable from the Grafana UI
grafanactl resources push dashboards -p ./resources --omit-manager-fields

# Dry run (no changes)
grafanactl resources push dashboards -p ./resources --dry-run
Workflow: Edit a dashboard
bash
# 1. Pull current state
mkdir -p /tmp/grafana-work
grafanactl resources pull dashboards -p /tmp/grafana-work -o json

# 2. Edit the JSON files (add panels, modify queries, etc.)

# 3. Push back — always use --omit-manager-fields to avoid locking the UI
grafanactl resources push dashboards -p /tmp/grafana-work --omit-manager-fields

Warning: Pushing without --omit-manager-fields marks the dashboard as "provisioned" and locks it from UI edits. Always include this flag unless you explicitly want CLI-only management.


Querying Prometheus Directly

You can query Prometheus through Grafana's datasource proxy API. This is useful for live investigation without touching the Grafana UI.

Instant query (current value)
bash
curl -s -u "$GRAFANA_USER:$GRAFANA_PASSWORD" \
  --data-urlencode 'query=YOUR_PROMQL_HERE' \
  "$GRAFANA_URL/api/datasources/proxy/uid/$GRAFANA_PROMETHEUS_UID/api/v1/query" \
  | python3 -m json.tool
Range query (time series)
bash
curl -s -u "$GRAFANA_USER:$GRAFANA_PASSWORD" \
  --data-urlencode 'query=YOUR_PROMQL_HERE' \
  --data-urlencode 'start=UNIX_TIMESTAMP' \
  --data-urlencode 'end=UNIX_TIMESTAMP' \
  --data-urlencode 'step=60' \
  "$GRAFANA_URL/api/datasources/proxy/uid/$GRAFANA_PROMETHEUS_UID/api/v1/query_range" \
  | python3 -m json.tool
List all metric names
bash
curl -s -u "$GRAFANA_USER:$GRAFANA_PASSWORD" \
  "$GRAFANA_URL/api/datasources/proxy/uid/$GRAFANA_PROMETHEUS_UID/api/v1/label/__name__/values" \
  | python3 -c "import json,sys; [print(n) for n in json.load(sys.stdin)['data']]"
Filter metric names
bash
# Find all RPC-related metrics
curl -s -u "$GRAFANA_USER:$GRAFANA_PASSWORD" \
  "$GRAFANA_URL/api/datasources/proxy/uid/$GRAFANA_PROMETHEUS_UID/api/v1/label/__name__/values" \
  | python3 -c "import json,sys; [print(n) for n in json.load(sys.stdin)['data'] if 'rpc' in n.lower()]"

Key Metrics

Application metrics (handy-server)
MetricTypeDescription
rpc_calls_totalcounterRPC calls by method and result (success, not_available, target_disconnected, timeout)
rpc_call_duration_seconds_buckethistogramRPC call duration by method
rpc_lookup_retries_buckethistogramNumber of retries per socket lookup by method
rpc_fetchsockets_timeouts_totalcounterfetchSockets timeout count by context (lookup, presence)
websocket_connections_totalgaugeActive WebSocket connections by type
websocket_events_totalcounterWebSocket events by type
http_requests_totalcounterHTTP requests by method, route, status
http_request_duration_seconds_buckethistogramHTTP request duration by route
session_cache_operations_totalcounterSession cache hits/misses by operation
session_alive_events_totalcounterSession keepalive events
machine_alive_events_totalcounterMachine keepalive events
database_records_totalgaugeRecord counts by table
database_updates_skipped_totalcounterSkipped DB updates by type
Show full SKILL.md (156 more words)Show less
Useful PromQL queries
promql
# RPC success rate by method
sum by(method) (rate(rpc_calls_total{result="success"}[5m]))
/ (sum by(method) (rate(rpc_calls_total[5m])))

# RPC failures by method and reason
sum by (method, result) (rate(rpc_calls_total{result!="success"}[5m]))

# RPC failures by type only
sum by (result) (rate(rpc_calls_total{result!="success"}[5m]))

# RPC P95 latency by method
histogram_quantile(0.95, sum by (method, le) (rate(rpc_call_duration_seconds_bucket[5m])))

# Socket lookup retry distribution (P95)
histogram_quantile(0.95, sum by (method, le) (rate(rpc_lookup_retries_bucket[5m])))

# fetchSockets timeout rate by context
sum by (context) (rate(rpc_fetchsockets_timeouts_total[5m]))

# HTTP error rate
sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m]))

# Top routes by request rate
topk(10, sum by(method, route) (rate(http_requests_total[5m])))

Dashboards

Happy Server Application Metrics
  • ID: 470da978-91f7-4721-be2c-cc451bf074a2
  • Tags: happy-server, application, websocket, http, database
  • Panels: WebSocket connections, session cache, alive events, HTTP metrics, database stats, RPC metrics
Adding a panel

When adding panels to a dashboard JSON, follow this pattern:

  1. Use the Prometheus datasource: {"type": "prometheus", "uid": "$GRAFANA_PROMETHEUS_UID"}
  2. Pick the next available id (check existing panels for max id)
  3. Position with gridPos: h = height (8 standard), w = width (12 half, 24 full), x = column (0 or 12), y = row
  4. Common panel types: stat, timeseries, piechart, bargauge, table
  5. Set appropriate unit: percentunit, ops, s, short, reqps

Tips

  • Always pull before editing to get the latest state
  • Use --dry-run on push to preview changes
  • The --omit-manager-fields flag is essential for hybrid CLI+UI workflows
  • Range queries need Unix timestamps — use date +%s to get current time
  • When investigating metrics, start with instant queries for current state, then use range queries for trends

© slopus, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/metrics-graphana of slopus/happy.

Open the folder on GitHubat commit fba320e

Compare with similar skills

Happy Infra Metrics and Grafana next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Happy Infra Metrics and Grafana compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Happy Infra Metrics and Grafana this skillslopus/happy24k—~2kAutomated safety check: NotesMIT
Archestra Dev Observabilityarchestra-ai/archestra4.4k—~1.2kAutomated safety check: PassCustom licence
Frontmcp Observabilityagentfront/frontmcp146—~4.6kAutomated safety check: PassApache-2.0
Monitoring Observabilityahmedasmar/devops-claude-skills203—~3.9kAutomated safety check: PassNone
Monitoring ExpertJeffallan/claude-skills12k—~1.6kAutomated safety check: PassMIT
Alloygrafana/skills281—~1.3kAutomated safety check: PassApache-2.0

Similar skills

  • Archestra Dev Observability

    archestra-ai/archestra

    A skill your agent uses when changing Archestra tracing, metrics, OpenTelemetry, Tempo, Grafana, Prometheus, LLM/MCP spans, observability labels, or local observability setup.

    4.4k GitHub stars~1.2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Frontmcp Observability

    agentfront/frontmcp

    A skill your agent uses when adding tracing, structured logging, metrics, or monitoring to a FrontMCP server.

    146 GitHub stars~4.6k tokensUpdated 2 days ago
    DevOps & CloudAuto-check passed
  • Monitoring Observability

    ahmedasmar/devops-claude-skills

    Monitoring and observability strategy, implementation, and troubleshooting.

    203 GitHub stars~3.9k tokensUpdated 6 mo ago
    DevOps & CloudAuto-check passed
  • Monitoring Expert

    Jeffallan/claude-skills

    Sets up application monitoring: structured logs, Prometheus metrics, OpenTelemetry tracing, Grafana dashboards, alert rules and load tests with k6 or Artillery.

    12k GitHub stars~1.6k tokensUpdated 6 days ago
    DevOps & CloudAuto-check passed
  • Alloy

    grafana/skills

    Official

    Build a unified telemetry pipeline with Grafana Alloy — one OpenTelemetry-compatible binary that collects metrics, logs, traces, and profiles and ships to Grafana Cloud / Prometheus / Loki / Tempo /…

    281 GitHub stars~1.3k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Golang Observability

    context-labs/whip

    Go observability — always-on production signals: slog logging, Prometheus metrics, OpenTelemetry tracing, pprof profiling, alerting, Grafana.

    1.1k GitHub starsUsed in 1 repo~3.3k tokens
    DevOps & CloudAuto-check passed

More from slopus/happy

All 8 skills in this repo
  • Searches past Claude Code, Codex and Cursor sessions and summarizes what was worked on, tried or decided, using extraction scripts instead of reading raw logs.

    24k GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • Agent Browser CLI

    slopus/happy

    Drives a real browser from the shell with the agent-browser CLI: open pages, snapshot elements by ref, click, fill and extract, for testing web flows.

    24k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Traces how an action moves through your code and draws it as a compact ASCII tree: functions called, payload types, state changes and components that re-render.

    24k GitHub stars~654 tokensUpdated today
    Auto-check passed
  • Local development guide for the Happy pnpm monorepo: install, build, test and run the CLI, server, Expo app and Tauri desktop packages.

    24k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Tests interactive CLI and TUI programs with Microsoft's tui-test, driving prompts, arrow keys and screen output in a real pseudo-terminal.

    24k GitHub stars~603 tokensUpdated today
    Auto-check passed
  • Walks you through releasing a component of the Happy monorepo (CLI, mobile, web or server) from a clean local main that matches origin/main.

    24k GitHub stars~6.6k tokensUpdated today
    Auto-check passed

Categories

Questions about Happy Infra Metrics and Grafana

What does Happy Infra Metrics and Grafana do?

Queries live Prometheus metrics and manages Grafana dashboards as code for Happy's infrastructure, using the grafanactl CLI and the Grafana datasource proxy API. env file into the shell before any command runs, and every grafanactl and curl command in the skill references them through environment variables rather than hardcoded values. The grafanactl CLI, installed through Go, lists resource types such as dashboards and folders, pulls dashboards to disk as JSON, and pushes them back to deploy changes, with a documented edit workflow of pulling the current state, editing the JSON, and pushing it back.

When should I use Happy Infra Metrics and Grafana?

Happy Infra Metrics and Grafana fits situations like: querying current or historical Prometheus metrics for Happy's infrastructure; pulling and editing a Grafana dashboard as code; adding or modifying a dashboard panel.

How do I install Happy Infra Metrics and Grafana in Claude Code?

Run `npx skills add slopus/happy --skill metrics-graphana -a claude-code`. Or copy the skill folder (.agents/skills/metrics-graphana in slopus/happy) into .claude/skills/metrics-graphana in your project. Claude Code loads it when a task matches its description.

How do I install Happy Infra Metrics and Grafana in Codex?

Run `npx skills add slopus/happy --skill metrics-graphana -a codex`. Or copy the skill folder (.agents/skills/metrics-graphana in slopus/happy) into .agents/skills/metrics-graphana in your project. Codex loads it when a task matches its description.

Can I use Happy Infra Metrics and Grafana in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add slopus/happy --skill metrics-graphana -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/metrics-graphana, .gemini/skills/metrics-graphana, .github/skills/metrics-graphana and .opencode/skills/metrics-graphana in your project.

What does Happy Infra Metrics and Grafana need to run?

Going by SKILL.md and its folder, Happy Infra Metrics and Grafana needs the command-line tools its instructions call (curl, python3 and go) and credentials named GRAFANA_PASSWORD. Our summary lists: grafanactl (installed via Go); Grafana and Prometheus credentials in a local .env file.

Does Happy Infra Metrics and Grafana access the network?

SKILL.md contains no URLs. Its commands use curl, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Happy Infra Metrics and Grafana safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Happy Infra Metrics and Grafana use?

Happy Infra Metrics and Grafana is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Happy Infra Metrics and Grafana use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Happy Infra Metrics and Grafana?

Skills that share tags, products or a category with Happy Infra Metrics and Grafana: Archestra Dev Observability (archestra-ai/archestra, 4.4k stars), Frontmcp Observability (agentfront/frontmcp, 146 stars), Monitoring Observability (ahmedasmar/devops-claude-skills, 203 stars) and Monitoring Expert (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Happy Infra Metrics and Grafana?

slopus (a GitHub organization) maintains it in slopus/happy, which has 24,066 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 9, 2026.

Source: slopus/happy on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.