setup-coding-agent
Set up Grafana Agent observability for a coding agent (Claude Code, Codex, Copilot CLI, Cursor, OpenCode, pi, Vibe, or experimental Kiro CLI) with the agento11y binary: install it, save credentials, wire the agent, verify a session reaches Grafana Cloud, and diagnose a broken pipeline. Use when the user says "set up agento11y", "monitor my coding agent", "agento11y doctor says something is wrong", "my sessions do not show up in Grafana", or asks why conversations arrive but analytics stay empty.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 133
- Forks
- 33
01 前言 Front Matter
- name
- setup-coding-agent
- description
- Set up Grafana Agent observability for a coding agent (Claude Code, Codex, Copilot CLI, Cursor, OpenCode, pi, Vibe, or experimental Kiro CLI) with the agento11y binary: install it, save credentials, wire the agent, verify a session reaches Grafana Cloud, and diagnose a broken pipeline. Use when the user says "set up agento11y", "monitor my coding agent", "agento11y doctor says something is wrong", "my sessions do not show up in Grafana", or asks why conversations arrive but analytics stay empty.
03 SKILL.md 正文
Set up a coding agent with Grafana Agent observability
Grafana Agent observability records model calls, tokens, timing, tool names, and
reported or estimated cost. Conversation content is opt-in. The agento11y
binary launches agents and hosts hook-based integrations; pi and OpenCode export
in process. This path installs and configures the integration. It never changes
the user's application code.
Do the steps the machine's current state calls for, not all five. Step 1 says where to start: a machine that needs one credential re-saved does not need a reinstall, and a working setup the user asked a question about needs no changes at all.
Rules
- Never mint, generate, or guess a credential. The token is a Grafana Cloud access-policy token that only the user can create. Ask for it, or tell the user where to click. A made-up token produces a 401.
- Never invent an endpoint URL. The API URL and the OTLP endpoint come from the setup page of the user's own stack (Step 3). Do not assemble one from the stack name; regions differ.
- Never print or echo a token, and never ask for the environment block in
chat. The block carries a live token, and this conversation can be
exported. The user pastes it into login's prompt or passes
--env-file <file>(-for a pipe). A token you pass yourself goes in with--token-stdin. - Do not edit application code. Adding SDK calls to the user's app is a
different job ("Path B"). If the user wants their own app or agent
instrumented, stop and hand off to the
agento11y-instrumentskill, which ships with thegcxCLI (gcx agent skills install agento11y-instrument). - Ask before enabling full capture or guards, or adding recipients. Default
metadata_onlygeneration exports exclude prompts, responses, and tool I/O;fullsends them to every enabled recipient, not justprimary. Guards send evaluated content only toAGENTO11Y_ENDPOINTregardless of capture mode. Local mode always stores full content locally.
Step 1: Read the current state
Run this first, every time, before changing anything:
agento11y doctor --json
If the command is not found, the binary is not installed: go to Step 2.
Branch on these fields. The JSON also reports auto-update state:
| Field | Meaning | Where to go |
|---|---|---|
agento11y.version |
The installed build. dev is an unstamped build, including one installed with go install. Always present when the command runs. |
command not found: Step 2 |
config.exists |
Whether the resolved config file exists. | false: Step 3 |
conversations.status |
The transcript pipeline: ok, warning, error. |
error: Troubleshooting |
analytics.status |
The OTLP metrics and traces pipeline. | error: Troubleshooting |
agents[] |
One entry per coding agent, with install_state and on_path. |
target agent not_installed: Step 4 |
Cursor is hook-based. install_state: installed means every agento11y Cursor
hook is present in ~/.cursor/hooks.json; not_installed means one or more is
absent. Run agento11y cursor install when the user wants Cursor wired;
re-running it is safe.
agento11y doctor exits 1 when conversations, analytics, or config is in
error. The agent list never fails the command: an agent the user does not have
is reported, not treated as a problem.
Run agento11y doctor without --json when you want the human report, and
share --json output when the user asks for something to send to support. The
JSON never contains the token value. It can contain a short token-scheme prefix,
such as glc_.
Step 2: Install the binary
Pick one method that matches the platform and how the user installs other tools.
Quick install (Linux and macOS):
curl -fsSL https://raw.githubusercontent.com/grafana/agento11y/main/plugins/agento11y/scripts/install.sh | sh
The script downloads the latest release for the OS and architecture to ~/.local/bin. It verifies the SHA-256 when sha256sum or shasum is available; otherwise it warns and continues.
Re-run it to upgrade. INSTALL_DIR changes the directory and VERSION pins a release.
Homebrew (macOS):
brew install grafana/grafana/agento11y
Upgrade with brew upgrade grafana/grafana/agento11y.
mise: mise use -g aqua:grafana/agento11y@latest (requires mise shell activation so agento11y is on PATH).
Go install (any platform with Go 1.26.9+):
go install github.com/grafana/agento11y/plugins/agento11y/cmd/agento11y@latest
This writes to go env GOPATH/bin, or GOBIN when set. On Windows the other
option is the windows_amd64 or windows_arm64 zip from the releases page:
extract agento11y.exe and put it on PATH.
Whichever method you use, the install directory has to be on PATH. Check the
result:
agento11y --version
The command was renamed from sigil. The quick installer and Homebrew also
install a sigil alias. go install installs only the binary you name. The old
name will be removed in a future release, so do not write new instructions
against sigil.
Step 3: Choose a destination
A first agento11y login asks where sessions go: Local only needs no Cloud credentials and never forwards; Grafana Cloud continues to credentials. Its Local web UI preference defaults to Yes and remembers an earlier answer: Yes keeps a full local copy and forwards a Cloud copy; No sends directly to Cloud.
The paste flow
Tell the user to run agento11y login in their own terminal, then wait. You
cannot drive it yourself: it needs a terminal, and the block it asks for holds a
live token that must not pass through this conversation. The destination question
appears only when no destination or credentials are saved. A
saved Cloud connection starts at step 2.
- Where should sessions go?: a two-option list. Local only saves local mode and ends the flow. Grafana Cloud continues with the steps below.
- Grafana Cloud connection: shown when both the stack URL and credentials are saved. Keep this connection is the default; Change connection continues below.
- Your Grafana Cloud URL: the Grafana they open in a browser, for example
https://mystack.grafana.net. The field arrives pre-filled from the stack an earlier run saved or from a gcx configuration, and becomes a list when more than one is known. It only builds the links below; it is never the ingest endpoint. - Login prints
https://<stack>/a/grafana-agento11y-app/setup-coding-agentand tries to open it in a browser. That page has three steps: create an API token, copy the connection settings, and paste them back in the terminal. The page creates the token when the user has permission and the stack supports it. Otherwise it links to Cloud Access Policies and accepts an existing token. - Paste from Grafana: the whole block goes into this one masked field, which fills the endpoint, instance ID, token, and OTLP settings, and presets the automatic tag answers when it sets them. Login asks only for what is missing. Pasting is optional: Enter on the empty box types the values one by one.
- Preferences: local web UI, content capture mode, session tags, guards and their timeout, and automatic tags. Enter keeps each answer. The web UI always stores full content locally; forwarding sends full content in Full mode and metadata otherwise. Read Rule 5 before enabling full capture or guards, and Automatic tags before enabling automatic tags.
The copied block has concrete values in this shape:
AGENTO11Y_ENDPOINT=https://agento11y-prod-<region>.grafana.net
AGENTO11Y_PROTOCOL=http
AGENTO11Y_AUTH_MODE=basic
AGENTO11Y_AUTH_TENANT_ID=<instance-id>
AGENTO11Y_AUTH_TOKEN=glc_...
OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-gateway-prod-<region>.grafana.net/otlp
OTEL_EXPORTER_OTLP_HEADERS='Authorization=Basic <base64-value>'
Without OTLP, default HTTP conversations work but Cloud analytics does not. Local recording and analytics need no Tempo or Cloud credentials. Login rejects placeholders; flags can replace pasted values. A pasted block fills in the form's preferences, such as content capture, guards and automatic tags, which the user can still change, and login saves the block's other settings. Login ignores a pasted auth mode other than basic, AGENTO11Y_HEADERS, and the guard timeout: guard checks use them and fail open, so any of them could let every tool call through. It also skips a key that chooses what agento11y runs or loads, where it sends anything but the stack's data, the agent name or version, or the user ID, a value that turns off secret redaction, TLS, guards, a fail-closed guard, or updates, or turns usage stats on, a name that is not upper case, and any name it does not know; it saves the rest, names the skipped keys on stderr, and exits 0. A block's endpoint, OTLP endpoint and stack URL must use https unless they are on this machine (see the README). --env-file <file> (- for a pipe) never prompts: the block and the flags must supply the endpoint, instance ID, and token, and a setting the block leaves out keeps its saved value. Flags beat the block's values, and --token-stdin can supply a token the file leaves out. Configure experimental OTel through the environment or config.env, as described in the Reference. Existing config keys stay.
For default HTTP capture and analytics, one token needs sigil:write, metrics:write, and traces:write. Generated policies can include extra scopes; the HTTP integrations use only these three.
The flags
--endpoint, --tenant, and a token together skip destination and value prompts, including over SSH, in a devcontainer, or a script. A failed credential check can still prompt on an interactive terminal. Use only values the user has already given you.
printf %s "$TOKEN" | agento11y login \
--endpoint https://agento11y-prod-<region>.grafana.net \
--tenant <instance-id> \
--token-stdin \
--otlp-endpoint https://otlp-gateway-prod-<region>.grafana.net/otlp
Before writing, login sends one credential-check request and reports the result. On failure it asks whether to save interactively; with nonterminal stdin it writes nothing and exits 1. Pass --yes to save regardless or --no-verify to skip the check. Preferences have no flags.
Login writes the resolved config path, retaining sigil/config.env under the same config root if only that legacy file exists. You can write it by hand instead:
AGENTO11Y_ENDPOINT=https://agento11y-prod-<region>.grafana.net
AGENTO11Y_AUTH_TENANT_ID=<instance-id>
AGENTO11Y_AUTH_TOKEN=glc_...
AGENTO11Y_OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-gateway-prod-<region>.grafana.net/otlp
A hand-written file needs no OTLP auth header: absent Authorization in OTEL_EXPORTER_OTLP_HEADERS, the launcher builds Basic authorization from the tenant ID and the first available OTLP or ingest token.
Step 4: Wire the coding agent
Six agents launch through agento11y <agent>. A first run asks where sessions go
as Step 3 describes, and Local only there starts the receiver for that launch.
The command then installs the host integration and replaces itself with the agent.
It asks nothing when local mode is already on (--local or AGENTO11Y_LOCAL=true)
or when stdin is not a terminal. Existing integrations follow the Auto-update
rules in the Reference.
| Agent | Command | Mechanism |
|---|---|---|
| Claude Code | agento11y claude |
shared Go binary, plugin agento11y-claude-code |
| Codex | agento11y codex |
shared Go binary, plugin agento11y-codex |
| Copilot CLI | agento11y copilot |
hooks shared with Copilot Chat in VS Code |
| OpenCode | agento11y opencode |
installs @grafana/agento11y-opencode; OpenCode 1.3.13 to 1.x or 2.0.22 to 2.x, other releases are refused; OpenCode 2 sessions get --standalone so a private server inherits launcher settings |
| pi | agento11y pi |
installs @grafana/agento11y-pi |
| Vibe | agento11y vibe |
shared Go binary via hooks.toml |
| Kiro CLI 3 (experimental) | agento11y kiro -- chat |
current workspace hooks; prompts/tools only, no assistant text, model usage, cost, or guards |
After the first agento11y codex launch, open /hooks inside Codex and trust
the agento11y hooks. Codex does not export turns until the user completes this
manual step, and doctor cannot detect whether they did.
Vibe hooks are experimental. The launcher enables them in the child process, so
launch Vibe through agento11y vibe for capture.
Cursor is the exception. It is a GUI application with no launcher, so wire it directly:
agento11y cursor install # merges the hook into ~/.cursor/hooks.json
agento11y cursor uninstall # removes it
On macOS and Linux, re-run agento11y cursor install after moving the binary;
Cursor's hook stores its absolute path.
For managed macOS deployment, after the administrator has placed the connection file for the target user, use agento11y claude install --json and agento11y cursor install; neither launches a host. missing_host for Claude means rerun after Claude Code is installed for that user.
Arguments after -- go to the underlying CLI unchanged:
agento11y claude -- --resume
Suggest the user alias the prefix (for example alias claude='agento11y claude')
only if they ask; silently shadowing their agent command is surprising.
Step 5: Verify
- Run the agent for one turn. Any prompt will do.
- Open Grafana Cloud, then Agent Observability, then Conversations. It usually appears within a few seconds; if it does not, continue to step 3.
- If nothing appears, run
agento11y doctor. For Codex, also confirm that the user trusted the hooks from/hooks. Read launcher stderr for lines starting withagento11y:.
For local capture, run agento11y local open. Check Sessions and Analytics > Overview. Optionally check Analytics > Skills after a recognized skill-load attempt in Claude Code, Pi, or OpenCode. For Cloud, confirm conversations and analytics separately. With default HTTP capture, conversations can arrive while Cloud Analytics stays empty. Check OTLP when that happens.
Troubleshooting
Run agento11y doctor first. It is read-only. It validates the required generation settings before probing the selected generation transport and reporting the HTTP status. With an OTLP endpoint configured, it sends separate metrics and traces probes and reports their HTTP statuses. With OTel selected, it checks opt-in and the trace route. A successful OTLP probe verifies transport and authentication, not generation ingestion. Read each probe message; some non-success responses are warnings.
The two pipelines
Default HTTP capture uses separate pipelines. Experimental OTel generations share the trace route.
- Conversations use
AGENTO11Y_ENDPOINT,AGENTO11Y_AUTH_TENANT_ID, andAGENTO11Y_AUTH_TOKENby default (sigil:write). With experimental OTel selected, Go producers use the configured OTLP trace route. - Analytics (the metrics and traces) export over
AGENTO11Y_OTEL_EXPORTER_OTLP_ENDPOINT, or the vendor-neutralOTEL_EXPORTER_OTLP_ENDPOINT. The token needsmetrics:writeandtraces:write.
If conversations work while analytics stays empty, the OTLP endpoint may be unset, the token may lack the metrics or traces scope, or the OTLP export may be failing for another reason. Doctor names the missing-endpoint case and probes both signals when an endpoint is set.
Reading the report row by row
endpointandtenant id: the resolved value and its source variable.not setmeans neither spelling was found. Doctor names the winningAGENTO11Y_*orSIGIL_*spelling.auth token:setand a short prefix. The value is never printed.probe: the HTTP status and URL. Analytics has separate metrics probe and traces probe rows.no responseincludes DNS, connection, timeout, TLS, and blocked-network failures.file: the config path and whether it exists.content capture: the effective mode and its source. Invalid values fall back tometadata_only; the section message names the variable to fix.guards:disabled, orenabledwith timeout and Cloud fail-open/closed. local rules namesguards.toml; local guard checks reports Cloud relay.- Coding agents: one row per agent.
not found on PATHmeans doctor cannot find that CLI.on PATH, plugin not installedcan mean never installed, removed, or installed for another scope.install state unknownmeans the read-only probe could not determine the state. Cursor has no install probe: the human row saysdetected <version>when present; only JSON reports unknown. Installation state does not confirm that the user trusted Codex hooks.
Status codes
- 401 on conversations: the token may be invalid, expired, or missing
sigil:write; the tenant ID may also be wrong. Sigil reports all of these as rejected credentials. - 401 on analytics: the OTLP credentials were rejected.
- 403: check the scope named in the probe message. Grafana's OTLP gateway can
use this for missing
metrics:writeortraces:write; doctor also handles it defensively for conversations. - Any redirect on the conversations probe:
AGENTO11Y_ENDPOINTis not an API URL. A bare stack URL can redirect to login. Doctor rejects a Grafana app page before probing it. Re-runagento11y loginand paste the block again.
Debug logging
Once a valid hook command is dispatched, hook failures and panics are swallowed so they do not crash the host agent. An invalid command line can still exit 2. Turn on the log for hook detail:
# ~/.config/agento11y/config.env
AGENTO11Y_DEBUG=true
Then read it:
tail -f ~/.local/state/agento11y/logs/agento11y.log
An install that still has the pre-rename ~/.local/state/sigil directory keeps
using it, with the new agento11y.log file name.
Reference
Config keys
All hosts read the resolved config path. The default is ~/.config/agento11y/config.env; $XDG_CONFIG_HOME changes the config root.
| Key | Meaning |
|---|---|
AGENTO11Y_ENDPOINT |
Conversations API URL; Cloud history destination identity even with OTel |
AGENTO11Y_AUTH_TENANT_ID |
Instance ID |
AGENTO11Y_AUTH_TOKEN |
Access-policy token |
AGENTO11Y_OTEL_EXPORTER_OTLP_ENDPOINT |
OTLP endpoint for metrics, traces, and opt-in OTel generations |
AGENTO11Y_PROTOCOL |
Generation transport: http (default) or experimental otel |
AGENTO11Y_ENABLE_EXPERIMENTAL_FEATURES |
true enables the OTel experiment; no legacy alias |
AGENTO11Y_STACK_URL |
The stack login asks about; builds links only, never ingest |
AGENTO11Y_CONTENT_CAPTURE_MODE |
Which content fields ship (see below) |
AGENTO11Y_TAGS |
key=value,key=value attached to every generation |
AGENTO11Y_AUTO_CODING_AGENT_TAGS |
Opt-in automatic user, repo, and branch tags |
AGENTO11Y_GUARDS_ENABLED |
Send supported preflight and tool calls for guard evaluation |
AGENTO11Y_GUARDS_TIMEOUT_MS |
Guard evaluation timeout in milliseconds |
AGENTO11Y_GUARDS_FAIL_OPEN |
Allow the operation when Cloud guard evaluation fails |
AGENTO11Y_LOCAL |
A true value routes agento11y <agent> launches, agento11y hooks, and history imports to the local daemon |
AGENTO11Y_LOCAL_FORWARD |
Forward local-mode captures to Grafana Cloud |
AGENTO11Y_THEME |
Local viewer theme: dark, light, or system; defaults to dark |
AGENTO11Y_AUTO_UPDATE |
A false value opts out of host-plugin refresh |
AGENTO11Y_DEBUG |
A true value writes the debug log |
AGENTO11Y_ANONYMOUS_USAGE_STATS |
disabled stops reporting usage statistics about the CLI itself; log prints them instead of sending |
Branded keys have older SIGIL_* spellings except AGENTO11Y_STACK_URL and AGENTO11Y_ENABLE_EXPERIMENTAL_FEATURES. SIGIL_PROTOCOL remains supported.
Local only writes AGENTO11Y_LOCAL and SIGIL_LOCAL as true, and both LOCAL_FORWARD spellings as false. Local web UI = Yes writes all four as true; No writes all four as false.
An explicit agento11y login still runs Cloud setup. Doctor reports provenance only for settings in its report.
Experimental OTel generation export
HTTP remains the default. To export generations as OpenTelemetry (OTel) spans, set these values in the environment or ~/.config/agento11y/config.env:
AGENTO11Y_PROTOCOL=otel
AGENTO11Y_ENABLE_EXPERIMENTAL_FEATURES=true
Configure AGENTO11Y_OTEL_EXPORTER_OTLP_ENDPOINT (or OTEL_EXPORTER_OTLP_ENDPOINT) and OTLP authentication. Use an endpoint that supports Agent Observability generation ingestion.
OTel export supports Claude Code, Codex, Copilot, Cursor, Vibe, and Kiro. Local mode, history imports, and Claude plugin eval imports also support OTel. Pi and OpenCode live plugins still use HTTP.
Guards, scores, and experiment APIs still need HTTP credentials.
Tagging sessions
--tag key=value is repeatable and goes before any --. It attaches tags to
every generation the launched session produces, and merges onto (and overrides)
AGENTO11Y_TAGS:
agento11y claude --tag project=hackathon --tag team=ai -- --resume
Every CLI launcher accepts it. Cursor has no launcher; set AGENTO11Y_TAGS in
the config file for Cursor sessions.
Automatic tags
AGENTO11Y_AUTO_CODING_AGENT_TAGS=true resolves the session's user, repository,
and branch and attaches them as client tags, which are the tags that also
become OTel metric labels. That is what lets the Usage and Cost view break down
by person, repository, or branch. The switch is off by default, and on its own
it enables all three names.
| Name | Tag key | Resolved from |
|---|---|---|
user |
user |
AGENTO11Y_USER_ID, then Claude's selected config-directory account file, Codex's auth.json email, or Cursor's saved session email before current hook email. Without either, no user tag is attached |
repo |
repo |
Full namespace from the checkout's origin remote, or the checkout directory name |
branch |
git.branch |
Checked-out branch, or a short commit SHA on detached HEAD |
Narrow the list with AGENTO11Y_AUTO_CODING_AGENT_TAGS_NAMES=user,repo. A key
already in AGENTO11Y_TAGS wins, an unresolved value leaves its key off, and an
unsupported name is logged and skipped. In Prometheus these arrive as
agento11y_tag_user, agento11y_tag_repo, and agento11y_tag_git_branch.
Warn the user before enabling this. For Claude Code, Codex, and Cursor, user can be a work email address retained as a Prometheus label.
Each value combination creates a time series, and branch names are unbounded. Start with user,repo.
Doctor shows repo and branch but cannot read a host's signed-in identity; set AGENTO11Y_USER_ID when the user value must be known before launch.
Other hosts have no account-email lookup. Discovery makes no provider requests, refreshes no credentials, and runs no host account commands. See local account identity sources. Those hosts get a user tag only from AGENTO11Y_USER_ID, so an automatic user tag is the session's user ID cut to its first 128 characters. Explicit tags never set identity. Account identity stays active when automatic tags are off. Use the same AGENTO11Y_USER_ID across plugins for consistent identity; arbitrary IDs and pseudonyms remain supported.
Content capture
AGENTO11Y_CONTENT_CAPTURE_MODE accepts full, no_tool_content, metadata_only, and full_with_metadata_spans. The default is metadata_only: model, tokens, timing, IDs, and cost when available, without message content or tool I/O. default aliases metadata_only; unknown values fall back with a warning.
For HTTP, full includes conversation content and tool arguments/results; metadata_only retains tool names and reduced structure.
For direct OTel export, the SDK upgrades full_with_metadata_spans to full, so generation spans contain content. OTel metadata_only drops whole message and tool-definition documents, unlike HTTP's structure-preserving reduction. Separate tool spans remain available.
Capture modes choose which fields ship. By default, every plugin redacts known secret formats from captured content, but redaction does not guarantee that shipped content is safe. Ask before enabling full, especially on shared machines. Hosts can omit or truncate fields.
Live skill-load recognition covers native tools in Claude Code and OpenCode, and catalog-matched instruction reads in Pi.
Recognized attempts mark existing tool spans with gen_ai.skill.name, including failures, without proving successful loading or explaining later actions.
Validated names remain in reduced modes; secret-like names are omitted. Recognition adds no descriptions, paths, or URIs and changes no payload policy.
Recognized attempts also add gen_ai.skill.name and agento11y.tool.execution.kind="load_skill" to the existing gen_ai.client.operation.duration histogram, including failures. Names remain under metric retention even in reduced modes; use stable, nonsensitive names.
Recognition excludes other hosts, imported history, direct /skill prompt insertion, resource reads, scripts, and attribution of later activity.
Claude Code and OpenCode retain requested identifiers, not resolved directory basenames; Pi retains catalog names. Only surrounding whitespace is trimmed.
Cloud skill trace visibility requires retained tool and generation spans in Tempo plus deployed Sigil consumer support. Local recording and analytics do not require Tempo.
Local mode
agento11y <agent> --local, Local only, or Local web UI = Yes routes launcher runs and agento11y hooks through the local daemon. The daemon stores full generation content in its JSONL store. It forwards full content only when AGENTO11Y_CONTENT_CAPTURE_MODE=full; every other selected mode becomes metadata_only for Cloud.
Local only does not forward. Local web UI = No sends directly to Cloud without a local copy. --no-local uses Cloud once without changing either saved alias family. The launcher prints the viewer URL. Manage the daemon with agento11y local start|open|status|stop|restart.
Local mode is available on every supported platform. A launcher starts the receiver in the same invocation; a saved choice from Cursor install applies to the next hook.
With AGENTO11Y_GUARDS_ENABLED=true, evaluate guards.toml next to config.env. reject = true blocks on match; shell_command is for shell policies. Fail-open is Cloud-only. For pack selection, configuration, and testing, follow agento11y skills show setup-local-guards.
Local Analytics > Skills counts all retained calls marked with a skill name, including loads, resource reads, commands, and failures. Case and namespace remain distinct. Tools and Skills overlap; never add their counts together. Duration coverage and p50/p95 describe tool calls, not skill effectiveness or cost. Skill row and chart links open Sessions filtered by the exact identifier, workspace, and time bounds. Summary tiles show matching sessions' in-period generation usage; session rows show lifetime totals. The token chart covers all generation usage in that range and workspace, not skill-attributed usage. Imports do not reconstruct missing skill metadata. See Local skill analytics for timing and retention limits.
Forward to extra destinations
The local daemon can forward each live payload to the existing connection from config.env, named primary, and up to three extra destinations (four total). primary is reserved, even when disabled. This applies only to daemon forwarding; direct export and --no-local are unchanged.
Put forwarding.toml beside the resolved config.env: normally ~/.config/agento11y/forwarding.toml, or $XDG_CONFIG_HOME/agento11y/forwarding.toml with a custom config root. If only the legacy sigil/config.env exists, put it in that directory instead. Extra destinations are configured only in this file, not through environment variables, login flags, or the viewer.
These are two extra records, not a replacement for primary. Replace example URLs and credentials with values from each destination's setup page:
destinations = [
{ name = "staging", endpoint = "https://agento11y.staging.example", tenant_id = "<staging-instance-id>", token = "<staging-token>", otlp_endpoint = "https://otlp.staging.example/otlp" },
{ name = "development", endpoint = "https://agento11y.development.example", tenant_id = "<development-instance-id>", token = "<development-token>", otlp_endpoint = "https://otlp.development.example/otlp" },
]
Keep the file private like config.env: mode 0600, with a 0700 parent directory (or equivalent user-only permissions). At the default path, run chmod 0700 ~/.config/agento11y and chmod 0600 ~/.config/agento11y/forwarding.toml.
Each record needs a unique nonempty name and at least one of endpoint or otlp_endpoint. HTTP generation export needs that record's tenant_id and token, except for recognized plain-HTTP loopback endpoints. otlp_token is optional. otlp_headers is an optional string of comma-separated name=value pairs, not a TOML table (for example, otlp_headers = "Authorization=Basic <base64-value>,X-Team=observability"). An explicit Authorization header wins; otherwise OTLP uses Basic authorization from that destination's tenant_id and otlp_token, falling back to its token. Extras inherit no endpoints, credentials, or headers from primary or the ambient environment.
Endpoints must be explicit HTTP(S) URLs without userinfo, query, or fragment. Recognized plain-HTTP loopback OTLP endpoints are still refused. More than three extras, unknown fields, duplicate names, or duplicate signal routes (the same effective URL and complete effective header set, including a primary route) invalidate the extras and produce diagnostics. Malformed or unreadable forwarding.toml disables all extras only, not the primary; no last-known-good extras remain active. An unreadable config.env disables all forwarding. File edits reload on the next ingest or status read, without a daemon restart.
AGENTO11Y_LOCAL_FORWARD=false (legacy SIGIL_LOCAL_FORWARD) stops all new forwarding work, including guard relay. The switch and capture mode are global: only exact AGENTO11Y_CONTENT_CAPTURE_MODE=full forwards full content to every recipient; all other modes use the existing metadata_only reduction.
Incoming HTTP generations go only to each recipient's Sigil HTTP endpoint; incoming OTLP traces and metrics go only to its otlp_endpoint. Configure both endpoints to receive both generation transports. The daemon does not re-record through an SDK or convert HTTP generations to OTLP, or OTLP generations to HTTP. Guards relay to primary only. Local history imports carry a no-forward marker that excludes every recipient.
Forwarding is best effort: one attempt per payload per destination, with a 10-second timeout, no retry, replay, or backfill. Each destination admits at most 8 in-flight requests and 128 MiB of input plus prepared output. The daemon has 2 shared preparation slots and allows at most 32 requests and 512 MiB across all destinations. Requests still running after a destination changes or is removed count toward the request and byte limits. Saturation drops affected copies without waiting; destinations are admitted independently. Status tracks attempted, succeeded, failed, and dropped requests per destination and signal. In-memory work can be lost on shutdown. A local acknowledgement confirms local acceptance, not remote delivery. Additional recipients increase network traffic, ingest costs, and memory use.
The viewer's Settings > Cloud controls forwarding and lists recipients before enabling full capture. Run agento11y doctor for destination status, counters, diagnostics, and the file path; edit extra destinations in forwarding.toml. Login does not list extra recipients. Full capture selected in login still applies to all recipients. Ask before enabling full capture or adding recipients. Disconnect turns global forwarding off and clears managed primary connection fields, but leaves extra destinations and their credentials saved. Unmanaged or inherited primary environment settings may remain too; re-enabling forwarding can reactivate saved extras and any remaining primary routes.
Test local guards offline
For an offline dry run, use agento11y guards test 'rm -rf ~/.ssh'. It does not execute input, check Cloud rules, contact endpoints, start a daemon, or write files. It tests saved policy even when host guard requests are disabled, without predicting host enforcement. Disabled rules and absent packs stay unchanged.
- Flags precede one quoted command:
agento11y guards test [--json] [--rules path] [--tool name] [--agent name] [--stdin] [--] <command>. Use--before a command starting with a dash. Alternatively,printf '%s\n' 'echo first' 'echo second' | agento11y guards test --stdinreads one command through EOF, preserving newlines. Blank commands and empty tool names are errors. --rulesbypasses configuration discovery; otherwise useguards.tomlbeside the resolvedconfig.env, including the legacysigilfallback. A missing default file or no enforceable rules returns allow with a notice. A missing explicit file is an error. Unchanged legacy packs receive the daemon's in-memory upgrade without changing the file.- The synthetic postflight request has one assistant tool call, ID
guards-test.--tooldefaults toBashand changes only the name; arguments remain{"command": ...}. Conditional rules see only--agent(default empty). There is no model, tags, agent version, preflight history, system prompt, or arbitrary host payload replay. --jsonemits one deterministic document:schema_version: 1,scope: "local",rules: {path, exists, compiled, enforcing},request: {command, tool_name, agent_name},response,errors, andnotices. Compiled and enforcing values are rule counts. Response is null when no evaluation completed; otherwise it preserves the engine result and ordered evaluations array. Transformed input uses SDK JSON with raw JSON tool arguments. Errors and notices are always arrays. After flag parsing, JSON errors use stdout; stderr stays empty unless writing stdout fails.- Exits:
0= completed allow, including warnings or transforms;1= completed deny;2= input, file, compilation, evaluation, or output error. Compilation errors take precedence. The output retains the partial response from valid rules. Failed evaluations include warnings and dropped redactions, not just denials. A response rule ID does not identify every transform that ran. Diagnostic JSON includes the submitted command and rewritten content. Do not use real secrets in shared test output; seeagento11y guards test --helpfor details.
History import
Until an import runs, the viewer and Grafana Cloud hold only sessions captured after installation.
agento11y history import backfills sessions claude-code, codex, cursor, opencode, or pi already wrote to disk. OpenCode supports v1 and released v2 databases. See History import for limitations.
An import sends generations and backdated trace spans but no metrics, so dashboards built on the gen_ai.client.* metrics leave imported history out.
agento11y history import claude-code --dry-run # plan only; no setup or export
agento11y history import claude-code --local # import into the local store
agento11y history import claude-code --no-local # import into Grafana Cloud
The import resolves the destination in this order: --no-local, --local, a true AGENTO11Y_LOCAL from shell or config.env, then saved Cloud credentials. With none set, an interactive run asks where sessions go; --no-local or any valid LOCAL value skips that question. Missing Cloud credentials still starts Cloud setup, without Local web UI, because local imports never forward to any recipient.
A noninteractive run never asks: only --all --yes imports; otherwise it prints a dry-run plan and exits 0.
Without --since, an import selects sessions active during the last 90 days. Each imported turn is recorded in a ledger per agent and destination, so an import into another destination sends the same turns without --force. If saved local mode would keep that import local, add --no-local.
Turns imported before that ledger count as already sent to every destination. Pass --force for them only after the user confirms they never reached that destination, with a --since that reaches back to the first import (a timestamp is safest); into Grafana Cloud, run it once, right after upgrading and before any other Cloud import, because --force re-sends every selected turn and Cloud stores and counts a repeat of a turn it received more than about a day earlier.
A cancelled or failed run resumes from turns not marked exported.
Auto-update
Claude, Codex, and OpenCode 1 refresh after a binary version change and, after
the first post-install refresh, at most once a day. A relaunch inside that period
does not pick up a plugin fix. AGENTO11Y_AUTO_UPDATE=0|false|no|off opts out.
Copilot and Vibe reconcile hooks on each launch. Pi leaves upgrades to pi's
installer. OpenCode 2 is never refreshed; run opencode plugin update @grafana/agento11y-opencode.
Further reading
04 同仓库更多 Skills
agento11y-eval-starter
暂无简介
agento11y-experiments
Run any Python LLM agent as an Agent Observability experiment using the public agento11y.experiments package: define a test suite, run an existing agent through typed trials, bind or record generation I/O, grade outputs, and publish scores, including from stored Grafana test suites.
agento11y
暂无简介
e2e-test
Optional credential-free Hermes integration checks using an explicit loopback model provider and local telemetry receivers. Inspect the scripts before running them; their defaults are not safe evidence of a local-only run.
setup-local-guards
Help choose, configure, and test local agento11y guard packs for coding-agent tool calls. Use when the user asks to enable safety packs, protect .env files, block dangerous commands, redact tool arguments, create custom local rules, or diagnose local guards. Covers local packs, not Grafana Cloud rule management or application SDK setup.
commit-message
Draft a commit message when the user describes a code change and asks for a commit message. Not for general questions or explanations.