Monitoring AI agents with ClickStack
Log what explains any run without storing what was said: origin, release, model calls and refusals, as OpenTelemetry events. Missing data reads as unknown.
Log what explains any run without storing what was said: origin, release, model calls and refusals, as OpenTelemetry events. Missing data reads as unknown.
Each customer's Twin runs as a full stack on its own server, shipped as immutable images through one path: one CI run, staging, then production on one commit.
Test AI like software: real cases, code checks for what must hold, a calibrated LLM judge for the rest, human audits, and a release gate on every change.
A recurring report. A slow review. A prototype that needs to work in the real world.
To understand an AI platform in production, log enough to explain any single run after the fact without storing what anyone said: which client started it, which release served it, which model calls it made, how many tokens they used, what it read and what it was refused. Ship that from every server as structured OpenTelemetry events into one store, render missing data as unknown rather than healthy, and watch the monitor from somewhere else.
We run this setup with ClickStack across the Company Twin fleet, where every customer has its own server. The very first audit of four days of production data turned up five real problems no user had reported, along with a short list of fields we wished we'd logged from day one.
Key takeaways
ClickStack is ClickHouse's open observability stack: ClickHouse for storage, HyperDX for search and dashboards, and the OpenTelemetry collector for shipping events. We run one instance on an existing server instead of spinning up another box. The obvious objection (that monitoring on a shared server can die with it) is handled by an independent observer on a separate host, covered below.
Every registered Linux host in the fleet ships four things: a heartbeat, resource metrics, capped operational logs and a report of which release it's actually serving. Each host's collector is fenced to 128 MiB of memory and a fifth of a CPU, with a persistent queue on disk so a store outage produces a replayable backlog instead of dropped data. We tested that by stopping the store and watching the queues drain on recovery.
The store carries the same kind of fence. It runs in a slice capped at four CPUs and 8 GiB on a dedicated filesystem, so filling it halts ingestion instead of filling the host's root disk. Thirty days stay hot; completed days export to object storage as Parquet before they age out.
Two access rules matter more than the tooling. The receiver gives every host its own mutual-TLS identity and strips any host or organisation claim a sender makes about itself, so a compromised server can't forge records from another. Organisation-scoped export also stays switched off until the mapping from authenticated context to organisation exists and negative tests prove one customer can't see another's rows. Sticking an organisation ID into a JSON field isn't isolation.
Engineers and their coding agents query the store as themselves through a read-only reader exposed as both a CLI command and an MCP server. It accepts one statement at a time, capped at 10 seconds, 512 MiB of memory and 10,000 rows, with four concurrent queries across everyone. Every call is journaled with the login and a hash of the SQL, never the text.
Every service and every customer uses one versioned event contract built on the OpenTelemetry log data model rather than an ad-hoc format. Customer-specific event names, formats or parsing branches aren't allowed: a dashboard that works for one server works for all of them.
| Field | What it holds |
|---|---|
| Timestamp and ObservedTimestamp | When it happened, and when it was collected, kept apart so ingest lag and clock skew are measurable |
| EventName | A stable name from a registry, such as a connector job failing; never derived from a message or a tenant |
| Body | A registered safe template or event code; no free text |
| service.name and service.instance.id | The logical component, and the actual slot or process that emitted it |
| service.version | The immutable commit the process is actually serving |
| Correlation IDs | Request, run, job and diagnostic IDs where they apply, length-capped and validated |
| Outcome, duration, error code | An outcome from a fixed list, milliseconds, and a classified failure code |
Each event family adds its own typed fields. Requests carry route template, method, status and duration, with no query strings, headers or bodies. Model gateway events carry provider and model, latency, status, token usage and a classified error, with no prompts or responses. Database events carry a readiness outcome and classified error, with no SQL, bind values or rows. Runs carry their lifecycle stage and correlation back to the request that started them.
Two rules prevent subtler bad data. Nothing is invented: a missing release, duration or organisation stays missing and never gets patched with a plausible default. And severity alone never pages anyone. Alerts key on registered events, duration, repetition and recovery; the word "error" in a log line isn't an incident. Our connector alert, for example, fires only after three consecutive distinct failed attempts of the same job, and a single success clears it.
Because the most dangerous dashboard is a green one with no data behind it. A host whose collector has died looks identical to a quiet, healthy host unless the system knows what it expected to hear. Every source declares its coverage, and a running collector on its own doesn't count as coverage. A server excluded from background probes is recorded as reachability unknown, health unknown and with no claim about its release.
The store itself is watched from outside. Our fleet observer, running on a different host, runs a small root-owned check against the store's server: is the container healthy, is HyperDX ready, and are real heartbeats from local and remote hosts still arriving? Missing data, a missing binary or a timeout all fail the check, returning only fixed failure codes. Failures go to the alert channel via the observer's own route, independent of HyperDX. We verified it by stopping the store: both the outage alert and the recovery arrived.
About a week after enrolment we sat down with four days of fleet telemetry. Because events carry no free text, a couple of findings named a symptom before its cause, yet every single one was actionable.
The quiet numbers mattered too. No host had a heartbeat gap over 70 seconds, the parser rejected nothing, exporters dropped nothing and model calls almost never failed. A clean bill of health only means something when you can point to the data behind it.
The audit was just as useful for what it couldn't answer. Here are the gaps it surfaced, in the order we'd close them on a fresh build. Since that audit we've added run origin, client kind on gateway rows, and each unit's memory against its own cap with an alert; the rest are still on our list.
Fields to log from the first day
Standard service dashboards (request rate, errors, latency) are necessary and nowhere near enough for an agent platform, where a single user question can fan out into a ten-minute run and sixty model calls. The views we actually open are:
These sit alongside per-answer receipts: telemetry shows how the platform behaved, while the receipt (see every AI answer needs a receipt) shows why one specific answer can be trusted. You need both, and you shouldn't try to make one do the other's job.
Most teams putting agents into production already have a logging tool. What's usually missing is the contract and the discipline around it. On a client build we'd:
It's the same principle behind evaluating AI systems: an AI system you can't measure is one you can't safely change.
Every Twin server ships content-free operational telemetry across the fleet: never prompts, never customer names. Look at how the Twin runs in production →