Local monitoring

From ObolNetwork/charon-distributed-validator-node · View interactive version

Local monitoring is an AI agent skill from the GitHub repository ObolNetwork/charon-distributed-validator-node. Query the local Grafana/Prometheus/Loki stack shipped with this CDVN repo. Use when investigating cluster health, charon/beacon/EL errors, peer connectivity, validator performance, or log patterns against the locally-running monitoring stack (not Obol's hosted Grafana).

How to use this skill

Skill file

Local Monitoring

Query the local monitoring stack (Grafana, Prometheus, Loki) that ships with this repo to investigate cluster health and diagnose issues.

For Obol's hosted Grafana (across all clusters), use the obol-monitoring skill instead. This skill is for the local stack only.

Prerequisites

Before running, verify:

  1. The monitoring stack is up: docker compose ps prometheus grafana loki shows them running
  2. Grafana is reachable on the host at http://localhost:${MONITORING_PORT_GRAFANA:-3000} (default 3000)
  3. The user knows their Grafana admin credentials, or has unauthenticated access enabled (default in this repo's grafana.ini)

If the stack isn't up, point the user to docker compose up -d prometheus grafana loki first.

Architecture notes

Gather Arguments

Use AskUserQuestion to clarify what the user wants to investigate. Common shapes:

  1. What to investigate — pick one:
  1. Time range — default last 15m; ask if investigating a specific incident
  2. Cluster scope — usually their own ($CLUSTER_NAME from .env); ask only if multiple clusters share this Prometheus

If the request is already specific (e.g. "show me charon errors from the last hour"), skip AskUserQuestion and proceed.

Execution

Instant query (Prometheus)

GRAFANA_URL="http://localhost:${MONITORING_PORT_GRAFANA:-3000}"
curl -sG "$GRAFANA_URL/api/datasources/proxy/uid/prometheus/api/v1/query" \
  --data-urlencode 'query=<PROMQL>'

Range query (Prometheus)

curl -sG "$GRAFANA_URL/api/datasources/proxy/uid/prometheus/api/v1/query_range" \
  --data-urlencode 'query=<PROMQL>' \
  --data-urlencode "start=$(date -u -v-15M +%s)" \
  --data-urlencode "end=$(date -u +%s)" \
  --data-urlencode 'step=30s'

Log search (Loki)

curl -sG "$GRAFANA_URL/api/datasources/proxy/uid/loki/loki/api/v1/query_range" \
  --data-urlencode 'query={service_name="charon"} |= "error"' \
  --data-urlencode "start=$(date -u -v-15M +%s)000000000" \
  --data-urlencode "end=$(date -u +%s)000000000" \
  --data-urlencode 'limit=200'

Fallback via `docker compose exec`

If the Grafana proxy is unavailable:

docker compose exec prometheus wget -qO- "http://localhost:9090/api/v1/query?query=<URL_ENCODED_PROMQL>"
docker compose exec loki      wget -qO- "http://localhost:3100/loki/api/v1/query_range?query=<...>"

For a query cookbook (cluster health, charon errors, peer ping, BN latency, validator effectiveness), see queries.md.

Output handling

Parse the JSON response and present results clearly:

If the response contains "status":"error", surface the error and errorType fields and stop — do not invent results.

Common diagnoses

When showing results, watch for these patterns and call them out:

Pointers to dashboards

Direct the user to the pre-provisioned dashboards in grafana/dashboards/ rather than reinventing them:

Open in browser: http://localhost:${MONITORING_PORT_GRAFANA:-3000}/dashboards.

Dependencies

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.