grafana/gcx/agento11y-instrument
Claude Code and agent skill by grafana/gcx
- community
Checking that the SKILL.md file is still in the repository.
Instruments a developer's own LLM app with the Agent Observability SDK, or repairs missing generations and empty Performance charts in Grafana Agent Observability. For model calls that already emit OpenTelemetry GenAI spans, it follows the OpenTelemetry guide instead of adding the SDK. Applies confirmed changes and verifies generation ingest, traces, and metrics. Excludes coding-agent telemetry plugins. For offline tests use agento11y-test-starter; for eval rules and guards use agento11y-prod-setup.
Install
npx vskill@latest install grafana/gcx/agento11y-instrumentSKILL.md
The same SKILL.md was published earlier as grafana/gcx/agento11y-instrument.
Agent Observability — instrument an LLM app
Help a developer wire their own LLM app or agent to Grafana Agent Observability, from zero or from a broken/partial state, and keep going until data actually lands in the stack. The value this skill adds over the static instrumentation prompt is two things a prompt can't do:
- A mechanical gap checklist run against the real code — headed by the one failure that is
completely silent (missing OTel providers → every metric lost, no error).
- A verification loop through
gcx: after each change, run the app and check the
gcx agento11y agents / conversations / generations commands to confirm generations arrived. Diagnose the next gap from what's missing, not from guesswork.
The SDK reference (env vars, provider snippets, field lists, framework adapters, workflow steps) lives in agento11y's llms.txt "Path B". Fetch it rather than restating it here; this file holds the flow and the decision logic. A minimal fallback lives in references/instrumentation.md for when the fetch is unavailable.
This skill sets up the SDK. If the app already emits OpenTelemetry (OTel) GenAI spans for its model calls, do not add the SDK for those calls (Step 2, otel). For those calls, follow the public guide Instrument agents with OpenTelemetry instead. The llms.txt section "Choose OpenTelemetry or the Grafana SDK" summarizes it.
Rules
- Reference, don't restate. Fetch SDK detail from
https://raw.githubusercontent.com/grafana/agento11y/main/llms.txt (Path B). Only inline decision logic here. If the fetch fails, fall back to references/instrumentation.md.
- Never invent an endpoint or a token. Read them from the environment (
AGENTO11Y_ENDPOINT,
AGENTO11Y_PROTOCOL, AGENTO11Y_AUTH_MODE, AGENTO11Y_AUTH_TENANT_ID, AGENTO11Y_AUTH_TOKEN, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS) or ask the developer. Never fabricate a URL or mint a token.
- Target is Grafana Cloud. The developer supplies the endpoint + token (Step 0), and the gcx
verification loop (Step 5) confirms data landing against the Cloud tenant. Never fabricate the endpoint or token — read them from the environment or ask.
- Write `AGENTO11Y_*` env vars, never `SIGIL_*`.
SIGIL_*is a deprecated legacy fallback. Do
this even if sibling apps or existing `.env` files in the repo use `SIGIL_*` — matching a stale local convention perpetuates it. If the app already reads SIGIL_*, add the AGENTO11Y_* names (the SDK still honors both) and note the old ones are deprecated. Do not "match the siblings."
- Gate every code WRITE on explicit confirmation. Report first (Step 4), apply only after the
developer says yes (Step 5). Read-only gcx verification and re-running the app happen freely inside the loop; editing files does not.
- Keep diffs small; do not change app behavior. Instrumentation is additive. No refactors, no
prompt rewrites, no dependency upgrades beyond the SDK/adapter packages actually needed.
- **Never change the model, provider, or the app's LLM config — not even with permission, not even
"just to run the verify loop." Instrument whatever model the app already uses. This is absolute: changing the model is out of scope for instrumentation, full stop. If a run fails because a provider API key is missing, the only allowed responses are: (a) ask the developer to provide the key for the model the app *already* uses, or (b) skip the live run and report the wiring as verified-by-construction, telling the developer to run it themselves. Do not offer to switch the provider, do not ask "which provider should I use?", and do not add a new provider dependency (e.g. `langchain-anthropic`) to make the run succeed. If the developer separately says they *want* a different model, that is an app change they own — tell them to make it and re-invoke this skill; do not fold it into the instrumentation diff. Swapping the model silently changes what the app does and what gets observed, which defeats the point. The provider API key (ANTHROPIC_API_KEY, OPENAI_API_KEY, …) is the app's own concern, not the instrumentation's — it authenticates the LLM call, not the telemetry export, and the app already has it if it runs at all. So don't ask for it, configure it, or rewire it; if the live verify-run fails on a missing provider key, skip the run and report verified-by-construction (see Step 5). Just don't conflate the two 401s: a 401 on generation ingest is observability auth and *is* yours to fix (usually a missing `AGENTO11Y_PROTOCOL`/`AGENTO11Y_AUTH_MODE`); an auth error from the model provider** is not — surface it and let the developer handle their own key.
- Do not assume language symmetry. Verify the provider wrapper / framework adapter actually
exists for the app's language before recommending it (Python has the most adapters, JS fewer, Go only google-adk, Java/.NET core + providers + google-adk). If it doesn't exist, hand-instrument with the core SDK. For calls without OTel GenAI spans (Step 2, otel), prefer, in order: provider wrapper → framework adapter → hand-instrumentation.
- The loop is bounded. At most ~3–4 instrument→verify iterations. If data still isn't landing,
stop and report what's checked and what remains — don't loop forever.
- Field-name traps:
cache_write_input_tokens, NOTcache_creation_input_tokens.agent_version
maps to the gen_ai.agent.version label and is required for per-version Performance charts. `MessageRole` (Python SDK) has only `USER`, `ASSISTANT`, `TOOL` — there is no `SYSTEM` (or `DEVELOPER`) member; MessageRole.SYSTEM raises AttributeError. Fold the system prompt into the USER message (or a text_part), and prefer the user_text_message() / assistant_text_message() / tool_result_message() helpers over hand-building Message(role=...). Always confirm enum members and helper names against the installed package before running — do not assume from llms.txt.
- Out of scope: offline test suites →
agento11y-test-starter; tenant eval rules + guards on
real traffic → agento11y-prod-setup. Coding-agent telemetry plugins (Claude Code, Cursor, …) → llms.txt "Path A". Any control-plane write.
- If a required input is missing (entrypoint, framework, endpoint, gcx auth), ask — don't guess.
Step 0 — Credentials and endpoint
If the app may already emit OTel GenAI spans for its model calls (Step 1, item 5), run Steps 1 and 2 first. When every call is otel and no SDK-only feature is needed, skip the AGENTO11Y_* vars only. The OTEL_* vars, the OTLP tile in point 3, and the rule against pasting a token into the chat still apply.
The app needs, in its environment before the SDK starts, seven vars — not five; the two mode vars are the ones most often forgotten, and their absence is a silent 401:
- generation ingest:
AGENTO11Y_ENDPOINT,AGENTO11Y_PROTOCOL=http,AGENTO11Y_AUTH_MODE=basic,
AGENTO11Y_AUTH_TENANT_ID, AGENTO11Y_AUTH_TOKEN.
- traces/metrics:
OTEL_EXPORTER_OTLP_ENDPOINT,OTEL_EXPORTER_OTLP_HEADERS.
AGENTO11Y_PROTOCOL=http and AGENTO11Y_AUTH_MODE=basic are required for Cloud, not optional — the SDK defaults (grpc / no-auth) return a silent 401 against the Cloud HTTP ingest endpoint. (They scope the ingest channel only; the OTel channel's transport/auth is set entirely by the OTEL_* vars — see references/instrumentation.md.) The only var that is sometimes omittable is OTEL_EXPORTER_OTLP_HEADERS: required when sending directly to the Cloud OTLP gateway (the common case, gateway enforces Basic auth), omittable only when OTEL_EXPORTER_OTLP_ENDPOINT points at a local Alloy / OTel Collector that already holds the Cloud credentials. First check what's already set (including any existing .env) — if all are present, skip to Step 1. Watch for the near-miss where the endpoint is set under the wrong name (e.g. AGENTO11Y_API_ENDPOINT — the SDK reads AGENTO11Y_ENDPOINT, so the wrong name is silently ignored and ingest falls back to a default host).
**When any value is missing, do NOT just list the variable names and ask — hand the developer theexact place to get each one (link + clicks), every time.** The concrete sources are in point 3below; surface them proactively. The most common failure of this skill is namingOTEL_EXPORTER_OTLP_ENDPOINT/OTEL_EXPORTER_OTLP_HEADERSand leaving the developer to guess — theanswer is the stack OTLP tile + "Generate now", which precomputes both. Give that first.
What gcx does for you (run these):
gcx config current-context— is there a working context? If not, **just ask the developer to log
in to the stack they want the instrumentation to connect to** — e.g. "run gcx login against your stack." Do not fabricate the login command yourself (don't guess the host or flags); let them run their own login (the Agent Observability setup screen gives them the exact command, or they use gcx login). Instrumentation itself needs no gcx login — only Step 5 verification does, so this never blocks writing the code.
gcx cloud orgs list— discover organisation slugs using browser Cloud OAuth.
If re-authentication is needed, use gcx cloud login with the same context; default scopes include profile and stack management. Access-policy tokens cannot list memberships and override OAuth when GRAFANA_CLOUD_TOKEN or cloud.<entry>.token is set. With access-policy authentication, ask the developer for their organisation slug instead. Have the developer select the intended slug, then run gcx cloud stacks list --org <org-slug> and gcx cloud stacks get <stack-slug> to identify the target stack and its URLs. This gives you the stack to point the developer at, and confirms which tenant the Step 5 verification will read from.
What still needs the Connection page (gcx cannot do these today):
- gcx does not generate the Agent Observability OTLP gateway URL, and does not mint the
ingest / access-policy token. When you ask the developer for a value, always tell them exactly where to get it — a link and the clicks — never just name the variable and wait. The two channels come from two different places:
`OTEL_*` (traces/metrics) — easiest, let Cloud build them. Send the developer to the stack's OTLP tile: https://grafana.com/orgs/<org-slug>/stacks/<stack-id>/otlp-info. It already shows OTEL_EXPORTER_OTLP_ENDPOINT and the Instance ID; under Password / API Token → "Generate now" it mints a token and then fills an Environment Variables block with all OTEL_* vars — the base64 `OTEL_EXPORTER_OTLP_HEADERS` is precomputed, ready to copy. No manual base64. (In Python, the value uses Basic%20… — keep it as given.)
`AGENTO11Y_*` (generation ingest) — the plugin Connection page. AGENTO11Y_ENDPOINT and the token come from https://<stack>.grafana.net/plugins/grafana-agento11y-app → Connection tab. When the developer creates the token via "Create a token in Cloud Access Policies", tell them the scopes: `sigil:write`, `metrics:write`, `traces:write`, `logs:write`. UI heads-up: sigil is not in the default resource list — add it via "Add scope" (then tick Write); the scope is still sigil:* (the Cloud resource keeps the old name). The same glc_… token works for both channels if it has all four scopes. Also set AGENTO11Y_PROTOCOL=http and AGENTO11Y_AUTH_MODE=basic (see references/instrumentation.md — the SDK defaults grpc/none give a 401).
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingclaude-plugin/skills/agento11y-instrument/SKILL.md
Popularity
- Repository stars
- 759
- Repository forks
- 56
- 7-day trend score
- 33
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/grafana/gcx/agento11y-instrument)