← ClaudeAtlas

setup-agent-otellisted

Use when a developer wants the AI coding agents on their machine (Claude Code, Claude Code Router, Gemini CLI, Codex CLI, OpenCode, Pi, Antigravity CLI) to export OpenTelemetry usage metrics to the agent-otel-gateway or any OTLP collector, asks to "設定 otel", "把 agent 接到 grafana", "enable telemetry for my agents", or wants per-user attribution on the shared dashboard.
lhchingit/agent-otel-gateway · ★ 1 · AI & Automation · score 74
Install: claude install-skill lhchingit/agent-otel-gateway
# Setup agent OTel ## Overview Every supported agent can send OTLP to one gateway; the gateway normalises the metrics and tags them with a `user` label taken from the `x-user` request header. This skill makes one machine emit correctly: detect agents → install what is missing → write each config idempotently → verify on the gateway. The per-agent facts live in `agents.md` (same directory) — read it, do not work from memory: several agents have non-obvious requirements that silently break export. ## Procedure 1. **Ask exactly one question up front**, with AskUserQuestion: the user name to report as (`x-user`), and — in the same call — whether the gateway is `http://localhost:4318` or another URL, and whether a one-line smoke prompt per agent (a few thousand tokens each) may be run for verification. Do not ask anything else; every other decision has a default in `agents.md`. 2. **Detect**: `bash <skill dir>/detect.sh` (`echo $OTEL_EXPORTER_OTLP_ENDPOINT` first if the gateway is remote). Present the table. 3. **For each installed agent**, follow its section in `agents.md`: back up the config (`.bak-YYYYmmddHHMM`), merge the required keys, install missing pieces (Pi extension, Antigravity hook), keep existing unrelated keys. 4. **Verify** per `agents.md` → Verification: gateway reachable; run the consented smoke prompts (or ask the user to run each agent once); confirm `user="<name>"` on the gateway's `:8889/metrics` for each agent. 5. **Report** a table: agent, what changed,