Grafana logs

From liuchengxu/dotfiles · View interactive version

Grafana logs is an AI agent skill from the GitHub repository liuchengxu/dotfiles. Investigate BTC Vault runtime incidents, daemon behavior, logs, or metrics with Grafana Loki and Prometheus. Does not apply to source-code logging edits or unrelated uses of the word log.

How to use this skill

Skill file

Grafana Logs & Metrics Skill

Datasource UIDs

If a UID below returns nothing or 404, call list_datasources to rediscover

before concluding there is no data — UIDs rotate when datasources are

recreated.

Loki

| Environment | UID | Trigger keywords |

|---|---|---|

| Testnet | ae9b8e3z0u4u8b | testnet, TBV testnet |

| Devnet | ddwaz0qqzgvswf | devnet, dev |

| Mainnet | cdvc8k8n8737kd | mainnet, prod, production |

| Tooling | cdvc8n7808feob | tooling, tools |

Prometheus

| Environment | UID |

|---|---|

| Testnet | ae9b890fmf9j4a |

| Devnet | cdvc8q8szvev4d |

| Mainnet | fdvc8owxsx3i8b |

| Tooling | prometheus |

Infrastructure Types

TV / Hetzner infra (default)

Ubernets / Kubernetes infra

Conditional noise filters

!= `eth_event_poller` != `getblockcount` != `getblockhash` != `getblock` != `rustls` != `reqwest` != `request for pegin` != `(will retry) `

and network/TLS messages can contain the cause.

that its class is irrelevant. Record which classes the query omits.

and remove exclusions before concluding that no relevant events occurred.

Query Workflow

  1. Identify environment from context -> resolve datasource UID
  2. Identify infra type (Hetzner vs Kubernetes) -> choose label set
  3. Discover hosts via list_loki_label_values if host not specified
  4. Default time range: 1 hour. Convert user-specified times to RFC3339.
  5. Build LogQL: base selector + relevant user filters (|= "txid"). Add only justified noise exclusions.
  6. Execute via query_loki_logs with limit 50, direction backward
  7. Present results highlighting errors, extracting pegin_txid/claim_txid for drill-down

Common Query Templates

Prometheus Metrics

All vaultd metrics are prefixed vaultd_* (defined in crates/vaultd/src/metrics.rs). Discover dynamically via list_prometheus_metric_names with filter vaultd_.

Completion checklist

Use evidence to complete this checklist. Mark an item N/A only with a reason. An unresolved applicable item is a delivery gap.

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.