> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudthinker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Chapter 8 · Observing the Observer

> Trace every agent decision, track fleet metrics for quality, latency, cost, drift, and security, and set SLOs that decide autonomy.

*You would never run a production service without traces, metrics, and SLOs, and an agent fleet is a production service whose failures are bad decisions, not exceptions. This chapter shows what to instrument and which numbers deserve an SLO.*

## 8.1 Why agent observability is different

An agent can look healthy on every classic signal (no exception, fast response, HTTP 200) and still be confidently wrong. So request and response logs aren't enough. You need the **decision graph**: what the agent saw, what it considered, which tools it called with which arguments, what came back, what it concluded, and what it spent.

The industry is converging on the **OpenTelemetry GenAI semantic conventions**, a shared schema for model calls, agent and tool spans, token usage, and cost. Major observability vendors ingest it, and mainstream agent frameworks emit it. Conventions for multi-agent work (tasks, handoffs, memory operations) are still being drafted in the OpenTelemetry GenAI working group.

The buying rule follows from that. Agent telemetry in an open schema means you can move it and audit it. Telemetry in a proprietary format locks you in at the layer you can least afford.

Hold CloudThinker to the same rule. Today it doesn't export OpenTelemetry GenAI traces to your own backend. What you can take out is the **Audit Logs** CSV (every agent and human action), the **Approvals → Activity** CSV (what each Rule decided), and the views on the **Usage** page. The table at the end of this chapter says where each one lives.

## 8.2 The trace anatomy

Record one trace per incident. Nest it like this:

| Level | Span | What to record |
| - | - | - |
| Root | The task (one incident or one request) | Incident ID, trigger, start and end time, final outcome |
| Child | Each agent invocation (the orchestrator and every subagent) | Agent name, goal it was given, total tokens and cost |
| Grandchild | Model call | Model, tokens in and out, latency, cost |
| Grandchild | Tool call | Tool name, arguments with secrets masked, result size, duration, errors |
| Event | Semantic milestone | Hypothesis formed, evidence attached, policy evaluated, approval requested and answered, action run, verification passed or failed, escalation |

Give the trace the same IDs as the incident record ([Chapter 4](https://docs.cloudthinker.io/learn/aio-engineer/chapter-4-orchestration-economics.md)) and the audit record ([Chapter 6](https://docs.cloudthinker.io/learn/aio-engineer/chapter-6-policy-approvals.md)). That gives you three views of one event, joined by shared IDs. An engineer can then go from "this felt slow" to "step 23 pulled 400 KB of logs and re-sent them four times" in one query.

```mermaid theme={null}
flowchart TD
    T["Trace: one incident"] --> O["Orchestrator span"]
    O --> A1["Subagent span: logs"]
    O --> A2["Subagent span: metrics"]
    A1 --> M1["Model call: tokens, latency, cost"]
    A1 --> C1["Tool call: args masked, result size"]
    A2 --> C2["Tool call: query, duration, errors"]
    O --> E["Events: hypothesis, policy, approval, action, verification"]
    T -. shared ID .- I["Incident record"]
    T -. shared ID .- L["Audit record"]
```

## 8.3 Metrics and SLOs for the fleet

The Field Guide's program KPIs ([§8](https://docs.cloudthinker.io/learn/aio/chapter-8-measuring.md)) measure outcomes: MTTD and MTTR, autonomous resolution rate, recommendation acceptance rate, rollback and intervention rate, repeat-incident rate, coverage ratio, on-call load, and agent unit cost. Underneath them, the fleet needs an engineering layer.

Two of the rows below mention "engines". These are the cheap sensing layer that watches every signal and the resolver that does deep reasoning on the few signals it promotes ([Chapter 4](https://docs.cloudthinker.io/learn/aio-engineer/chapter-4-orchestration-economics.md)).

| Family | Metrics | Why it matters |
| - | - | - |
| **Quality** | Diagnosis accuracy on the golden set, per incident class; online acceptance rate; rollback and intervention rate; evidence-integrity failures caught | This is the agent's error budget |
| **Latency** | Time to first finding, time to plan, end-to-end resolution time, as percentiles split by incident class and by engine (sensing promotion lag versus resolver duration) | Shows where the time goes, and which engine to fix |
| **Cost** | Tokens and spend per step, per investigation, and per resolved incident; promotion rate between the two engines; spend by model and by agent | A looping agent is a cost incident with excellent prose. Alert on cost anomalies the way you alert on cloud-spend anomalies |
| **Behavior drift** | Tool-call mix per incident class, step counts, escalation rate, refusal rate | Drift after a model swap, a prompt change, or no visible change at all is your early warning. It feeds the regression gates in [Chapter 7](https://docs.cloudthinker.io/learn/aio-engineer/chapter-7-evaluating-agents.md) |
| **Security** | Injection patterns found in context, new egress destinations, spikes in policy denials, unusual tool sequences | The detection layer from [Chapter 5](https://docs.cloudthinker.io/learn/aio-engineer/chapter-5-threat-model.md), turned into metrics |

Don't put an SLO on everything. Pick the few that carry the program. These example targets are starting points to tune against your own baseline:

| SLO | Example target | Window |
| - | - | - |
| Time to first finding on promoted P1 incidents | Under 5 minutes at p90 | Rolling 28 days |
| Diagnosis accuracy for each graduated incident class | At least 85% of reviewed incidents marked accurate | Rolling 28 days, with at least 20 reviews |
| Cost per resolved incident | No more than 20% above the previous quarter's average | Calendar month |

With SLOs and error budgets, the trust ladder ([Field Guide §7.3](https://docs.cloudthinker.io/learn/aio/chapter-7-humans-on-the-loop.md)) stops being a judgment call. A class graduates when it stays inside its budget, and drops back when it burns through it.

> [!NOTE]
>
> **IN PRACTICE: WHO WATCHES THE AGENTS?**
>
> A fair objection to any agent platform: "we're deploying it to cut toil, so who operates it?" The answer should be instrumented software, held to the same discipline it brings to your estate. Here is where CloudThinker shows you its own agents:
>
> | You want to see | Where |
> | - | - |
> | Each tool call an agent made, and its reasoning | The conversation itself. Every tool call appears as a step, and **Show reasoning** expands the agent's thinking. Each Resolve incident opens its own investigation conversation |
> | How full the context is | The **Context window** meter in the prompt box shows the tokens a conversation uses, split into system prompt, system tools, skills, and messages. Per-step tokens, cost, and duration aren't shown |
> | Every action an agent took in a connected system | **Admin Settings → Audit Logs** (Scale, Scale Plus, and Enterprise plans). Agent rows carry a bot badge with the agent's name, the **Agent Actions** tile counts them, and an event links to its Resolve incident ID. Export to CSV before the 90-day retention ends |
> | Who and what spends credits | **Admin Settings → Usage**, sliced **By Feature**, **By User**, and **By Workspace**. It doesn't break spend down per incident or conversation. To estimate cost per resolved incident, narrow the chart to one feature with the **All features** filter, then divide by the incidents resolved in the same range |
> | A hard stop on runaway spend | **Admin Settings → Credit limits** (Scale plan and up). **Throttle** blocks paid spend at the monthly limit, and optional alerts fire at 80% and 100%. The limit is checked when a run starts: a run already going finishes, and new investigations and automations in that workspace can't use paid credits until the cycle resets or you raise the limit |
> | Whether diagnoses were right | **Resolve → Insights → Accuracy & trust**, built from your team's verdicts |
>
> See [Audit Logs](https://docs.cloudthinker.io/guide/security/audit-logs.md), [Usage](https://docs.cloudthinker.io/guide/billing/usage.md), [Credit limits](https://docs.cloudthinker.io/guide/billing/credit-limits.md), and [Resolve Insights](https://docs.cloudthinker.io/guide/incident/insights.md). **Admin Settings** is the organization menu, and only organization Owners and Admins see it. Ask every vendor, us included, to show you these records for their own agents and how you get them out.

### Set up your first agent controls

**1. Cap spend per workspace**

Go to **Admin Settings → Credit limits**. Under **When a workspace hits its monthly limit**, pick **Throttle** for sandbox workspaces or **Notify only** for production. Set **Default monthly limit per workspace** about 20% above a typical workspace's monthly spend, check both alerts under **Alert the organization owner at**, and click **Save**.

**Success state:** the save bar disappears, and **Per-workspace limits** shows each workspace's usage against its limit.

**2. Pull a week of agent actions**

Go to **Admin Settings → Audit Logs**. Set **Actor Type** to **Agent** and the date range to **Last 7 days**, then click **Export CSV**.

**Success state:** your browser downloads `audit-trail.csv`, with one row per agent action and an `agent_name` column. Rename it with its date range, since every export has the same name.

> [!TIP]
>
> **KEY TAKEAWAY**
>
> Instrument decisions, not just calls. Record one trace per incident with model, tool, and milestone spans in an open schema. Track fleet metrics for quality, latency, cost, drift, and security. Put SLOs on the few that carry the program, so graduating a class to more autonomy becomes arithmetic. If you can't see what the agent decided and spent, you aren't supervising it.

## Next steps

> [card] [Chapter 9 · AgentOps: Running the Fleet on Day 2](https://docs.cloudthinker.io/learn/aio-engineer/chapter-9-agentops-day-2.md)
>
> Version changes, migrate models, keep memory clean, and run postmortems for agents.

> [card] [Audit Logs](https://docs.cloudthinker.io/guide/security/audit-logs.md)
>
> Filter, inspect, and export every action agents and people take.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.