agent-observability

A guide to monitoring AI agents and other applications that use language models. It covers logs, traces, response time, token usage, costs, errors, service targets, and protection of personal data.

In plain words
What is it for?
Use it with multi-step agents, language-model APIs, retrieval-augmented generation pipelines, multi-agent systems, or batch inference jobs. It helps add tracing, metrics, dashboards, cost tracking, alerts, and personal-data redaction.
Why use it?
It helps explain slow, expensive, failing, or poor agent responses instead of searching through raw logs without context. Teams can also see usage spikes and assign costs to requests.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/bagelhole/devops-security-agent-skills/agent-observability
Any agent
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill agent-observability
Clone the repo
git clone --depth 1 https://github.com/BagelHole/DevOps-Security-Agent-Skills

Made for: Claude Code, Codex.

Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,887 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00026 $0.08887
Opus 5 $0.00013 $0.04444
Sonnet 5 $0.00005 $0.01777
Haiku 4.5 $0.00003 $0.00889

Measured yesterday against content hash 8f2bdc0a8415, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agent-observability scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

devops/ai/agent-observability/SKILL.md · 1,083 lines

How it starts

The opening of the file, as written. The whole thing — 1,083 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Observability

Monitor AI agent behavior with logs, traces, metrics, and cost telemetry. This skill covers the full observability stack for LLM-powered applications: from raw Prometheus counters to Grafana dashboards, OpenTelemetry tracing, structured logging, cost tracking, SLO definition, and PII redaction.


When to Use

Apply this skill whenever you operate:

  • Autonomous AI agents that make multi-step tool calls (e.g., coding agents, support agents, data-pipeline agents).
  • LLM-backed APIs serving chat completions, summarisation, or classification behind a REST or gRPC gateway.
  • RAG pipelines where a retriever fetches context from a vector store before prompting a model.
  • Multi-agent orchestrations (crew-style or graph-based) where several agents collaborate on a single task.
  • Batch inference jobs that process thousands of prompts against a model endpoint.

Key signals that you need this skill:

  1. You cannot answer "what is p95 latency for agent responses this week?"
  2. You have no per-request cost attribution.
  3. Debugging a bad agent response requires grepping raw application logs.
  4. You have no alerting on token-usage spikes or elevated error rates.

Core Metrics

Define these metrics at the application layer. All examples use the Prometheus client library naming conventions.

Latency

from prometheus_client import Histogram

# Total end-to-end latency for a full agent turn (user prompt -> final response)
AGENT_LATENCY = Histogram(
    "agent_request_duration_seconds",
    "End-to-end latency of an agent request",
    labelnames=["agent_name", "model", "status"],
    buckets=(0.25, 0.5, 1, 2, 5, 10, 30, 60, 120),
)

# Latency of a single LLM API call (one completion request)
LLM_CALL_LATENCY = Histogram(
    "llm_call_duration_seconds",
    "Latency of an individual LLM API call",
    labelnames=["model", "provider", "stream"],
    buckets=(0.1, 0.25, 0.5, 1, 2, 5, 10, 30),
)

# Latency of tool/function calls executed by the agent
TOOL_CALL_LATENCY = Histogram(
    "agent_tool_call_duration_seconds",
    "Latency of a tool call executed by the agent",
    labelnames=["tool_name", "agent_name", "status"],
    buckets=(0.05, 0.1, 0.25, 0.5, 1, 2, 5, 10),
)

Read the full file on GitHub · 1,083 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 1,083 lines · 26 tokens per session scan A 8f2bdc0a8415

Subscribe to this mod's changes

agent-observability is a skill published in the GitHub repository BagelHole/DevOps-Security-Agent-Skills (932 stars, last pushed 3mo ago), licensed MIT. It adds 26 tokens to every session and 8,887 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.