Grafana Agent Observability SDK
Grafana Agent Observability monitors the agents you build and the coding agents you use. This repo provides the open-source SDKs and plugins that send telemetry to it.
Coding agent observability
Capture sessions from the coding agents you already use — Cursor, Claude Code, Codex, Copilot CLI, OpenCode, Pi, Vibe, experimental Kiro CLI, and others — so you can observe usage, cost, tokens, and tools across all of them in one place.
For Hermes, use its separate Python plugin guide. The shared launcher does not support Hermes.
For the other coding agents, install agento11y:
# Linux or macOS
curl -fsSL https://raw.githubusercontent.com/grafana/agento11y/main/plugins/agento11y/scripts/install.sh | sh
# macOS with Homebrew
brew install grafana/grafana/agento11y
# Windows, or any platform with Go 1.26.9+
go install github.com/grafana/agento11y/plugins/agento11y/cmd/agento11y@latest
Then run agento11y login and launch your agent, for example agento11y codex. The Coding Agent Observability guide covers all install options, configuration, and supported agents.
Observability for agents you build
Use Grafana Agent Observability to monitor generations, tools, cost, traces, and evals in your apps and services. Choose compatible OpenTelemetry instrumentation or a Grafana SDK (Go, Python, JS, .NET, Java).
Use existing OpenTelemetry instrumentation
OpenTelemetry GenAI spans can populate conversations, including captured prompts, responses, tool calls, and token usage, without a Grafana SDK or a custom generation exporter. Metrics alone do not carry this content.
Follow Instrument agents with OpenTelemetry to configure your stack's OTLP endpoint, opt in with agento11y.record=true, and capture GenAI message attributes. Reuse gen_ai.conversation.id across calls in a conversation. A framework does not need a dedicated Grafana adapter, but its exported spans must match the supported format.
For the requirements and the differences from SDK export, refer to OpenTelemetry setup. Do not export the same call through both instrumentation paths. The rest of this README covers the Grafana SDK path.
Instrument an application with an AI coding agent
If you want your own app or agent code instrumented, the recommended path is the agento11y-instrument agent skill. gcx is Grafana's CLI for working with Grafana Cloud resources; see the gcx installation docs if you want more detail.
Install gcx with the quick install script:
curl -fsSL https://raw.githubusercontent.com/grafana/gcx/main/scripts/install.sh | sh
Or with Homebrew:
brew install gcx
Then install the skill:
gcx agent skills install agento11y-instrument
If gcx is already installed but the skill is missing, update gcx first. Homebrew users can run brew update && brew upgrade gcx; script users can re-run the quick install script.
Use the `agento11y-instrument` skill to instrument this codebase with Grafana Agent observability.
The skill inspects your code, applies the SDK with small diffs after confirmation, and verifies that data lands in Grafana Cloud with gcx agento11y.
If your agent does not support skills, give it llms.txt and ask it to Instrument this codebase with Grafana Agent observability. The agent wires the SDK into your app or agent code.
Or open the Agent Observability plugin in your Grafana Cloud stack and use the onboarding wizard.
Instrument an application manually
Set the AGENTO11Y_* env vars and construct the client. To configure it explicitly instead, see the per-SDK READMEs linked under SDKs.
TypeScript
import { Agento11yClient } from "@grafana/agento11y";
const client = new Agento11yClient(); // reads AGENTO11Y_* env vars
await client.startGeneration(
{ conversationId: "conv-1", model: { provider: "openai", name: "gpt-5" } },
async (recorder) => {
recorder.setResult({ output: [{ role: "assistant", content: "Hello" }] });
},
);
await client.shutdown();
Python
from agento11y import Client, GenerationStart, ModelRef, assistant_text_message
client = Client() # reads AGENTO11Y_* env vars