AI & Data18 November 202610 min read

From AI Prototype to Production — Part 8 of 10

AgentOps in practice: observe, evaluate and improve

An agent you cannot trace to a prompt version, a model and the evidence it retrieved is an agent you cannot improve safely. Part 8 of From AI Prototype to Production is the engineering build: a trace schema, four evaluation loops, canary and rollback, and a six-part KPI scorecard.

#AgentOps#Observability#AI Evaluation#OpenTelemetry#AI Operations
A workbench holding a few loose glass blocks, connected by a cyan line to a large, orderly frame of lit modules with a small yellow status light, in a dark workshop over a faint map of southern Africa.

A member phoned Swartberg Health Administrators, our fictional South African medical scheme administrator, to complain that the online assistant had told her a scan needed no pre-authorisation. It did. The operations lead asked the engineering team a simple question: which version of the assistant gave that answer, which benefit rule did it read, and is it still giving it to other members? The team had logs. They had a latency dashboard and a monthly token bill. It took them four days to answer, because the logs held the model's text but not the prompt version, the index version or the identifiers of the passages it had retrieved.

That is the engineering gap this part closes. Part 5 of The Enterprise AI Control Plane set out the AgentOps operating model: six planes, named owners and a release bundle. This part is about building it. What goes in the trace, how evaluation runs before and after release, how a change is canaried and rolled back, and which measures tell you the agent is still doing its job.

Three planes, one feedback system

For engineering, the six operating planes collapse into three that you build and wire together.

The AgentOps feedback system: runtime, observability and evaluation, continuous improvementRUNTIME PLANEOBSERVABILITY AND EVALUATION PLANECONTINUOUS IMPROVEMENT PLANEMember or staffrequestContext andretrievalModel proposes,tools executeAnswer oractionTraces with versions,cost and evidenceOnline monitorsand alertsSampledhuman reviewKPI scorecardby releasePromote orroll backCanary on ashare of trafficOffline evaluationgateFailures becometest casesA CHANGE REACHES PRODUCTION ONLY THROUGH THE GATE AND THE CANARY
Read the three planes top to bottom. The runtime plane serves each request and emits a trace at every step. The observability and evaluation plane turns those traces into monitors, a human review sample and a scorecard for each release. The improvement plane turns failures into test cases, and a change only reaches the runtime again after it passes the offline gate and a canary. The return path on the left is the point: nothing changes in production without passing back through evidence.
  • Runtime serves requests, as Part 2 described. Its AgentOps job is to emit good telemetry at every step.
  • Observability and evaluation stores traces, runs monitors, samples answers for human review and scores each release.
  • Continuous improvement turns failures into test cases and moves every change through the offline gate and a canary.

The arrow that matters is the one back into the runtime. If a prompt can be edited in a configuration screen and go live without passing through the gate, the other two planes are decoration.

Design the trace before you need it

Swartberg's four-day investigation was a schema problem. A useful trace answers "what produced this answer, from what evidence, at what cost, and was it any good?"

The OpenTelemetry semantic conventions for generative AI give standard names for much of this. As checked on 18 November 2026, every document in the conventions repository is still at Development status, so names can change. Use them, pin the version you implement and review it when the conventions move. CloudNala's a trace is not an evaluation covers the wider field list and the status history; the table below is the minimum Swartberg now records on every run.

Question the trace must answerFieldStandard name, or your own
Which operation was this?Operation typegen_ai.operation.name (for example invoke_agent, chat, retrieval, execute_tool)
Which agent and which version?Agent name and versiongen_ai.agent.name, gen_ai.agent.version
Which model was asked for, and which answered?Requested and served model, providergen_ai.request.model, gen_ai.response.model, gen_ai.provider.name
Which release bundle was live?Bundle identifier covering prompt, policy, tools and settingsYour own attribute
Which prompt and policy text?Prompt version, policy rule versionYour own attributes
What evidence was retrieved?Data source, index version, passage identifiers and scoresgen_ai.data_source.id plus your own
Which tools ran?Tool name and call identifiergen_ai.tool.name, gen_ai.tool.call.id
What did it cost?Input and output tokens, cost estimate, price table versiongen_ai.usage.input_tokens, gen_ai.usage.output_tokens, plus your own cost fields
Which conversation and case?Conversation and case identifiersgen_ai.conversation.id plus your case reference
Was it any good?Evaluation name, score and labelThe gen_ai.evaluation.result event

Three design choices carry most of the value.

Record the requested and the served model separately. When a gateway falls back to another model, as Part 5 describes, the two differ. If you only store one, a quality drop during a fallback looks like a prompt problem.

Store retrieval evidence as references. Passage identifiers, index version and scores let you replay what the agent saw without copying text into the trace. Swartberg's answer would have pointed straight at last year's benefit schedule, still in the index after the rule changed. Part 4 covers index versioning.

Attach evaluation results to the span they judge. The conventions define a gen_ai.evaluation.result event with an evaluation name, a numeric score and a label such as pass or fail, parented to the operation it evaluated. Quality and telemetry then sit in the same query.

Leave content capture off by default. The conventions make capture of input messages, output messages, system instructions and tool arguments opt-in, and flag them as likely to hold sensitive information. In a medical scheme administrator, the prompt is health information. See do your observability tools store the prompt? before you switch any of it on.

Four evaluation loops, each with a job

Swartberg runs four evaluation loops, and each catches something the others miss.

LoopWhen it runsWhat it catchesGate or signalOwner
Offline evaluationEvery bundle change, before releaseRegressions on known cases: wrong benefit rule, missing citation, unsafe tool callBlocks release if below thresholdProduct team with a clinical or benefits reviewer
Canary comparisonFirst days of a release, on a share of live trafficProblems that only real questions exposePromote, hold or roll backRelease owner
Online monitoringContinuously, on sampled or all production tracesDrift, rising fallback rate, cost spikes, policy denialsAlerts to on-call and product ownerPlatform or SRE team
Human reviewDaily sample of production answersErrors that read well, which automated judges and users both acceptFeeds new test cases and the quality KPIBenefits operations team

The offline set is the anchor. Build the evaluation system before the agent and evals that gate real work cover how to build one. The engineering rule here is narrower: the offline set is versioned in the same repository as the bundle, and the pipeline refuses to deploy a bundle whose evaluation run is missing or older than the bundle.

Human review is the loop teams cut first and should cut last. Automated groundedness checks are useful at volume, but only after they have been compared with human labels on the same cases. A model-based judge that agrees with your reviewers on, say, seven cases in ten is a weak alarm, not a gate.

Canary and rollback for an agent

Google's SRE Workbook defines canarying as "a partial and time-limited deployment of a change in a service and its evaluation". It also advises comparing the canary population with a control population directly, because whole-service metrics can hide a failing canary, and running only one canary at a time so you can tell which change caused a signal. For agents, both points matter more than usual, because a prompt change and a model change at the same time leave you with no idea which one moved quality.

Here is Swartberg's canary for a new benefit-query bundle, with illustrative figures for a fictional organisation.

AssumptionValue
Member and provider queries per working day12,000
Canary share5% of queries, low-risk query types only
Human review sample5% of canary queries, and the same number from control
Canary length3 working days
Rollback thresholdGroundedness in the reviewed sample below 95%

Working: 5% of 12,000 is 600 canary queries a day. A 5% review sample is 30 a day, so 90 reviewed canary answers over three days, with 90 control answers reviewed alongside. At a 95% threshold, 90 × 0.05 = 4.5, so the canary can have at most four unsupported answers. Five unsupported answers is 85 out of 90, or 94.4%, and the bundle rolls back.

Ninety reviews catch a large regression early. They cannot prove a small improvement with statistical confidence, so be honest about which one the canary is for.

Rollback must be one action, and it must restore the whole bundle: prompt, policy, tool definitions, model pin and retrieval settings. Swartberg times a rollback in staging every release.

The KPI scorecard

System metrics are necessary. Google's SRE book names four golden signals for any user-facing system: latency, traffic, errors and saturation. An agent needs those plus measures of whether the task was done well, safely and affordably. Swartberg reports six groups, per release bundle, so a change in any of them can be tied to a change in the bundle.

GroupMeasuresComes from
ReliabilityRuns completed without error, tool-call failure rate, fallback rate (requested model differs from served)Trace status, tool spans, model fields
Latency95th percentile time to a usable answer per task, not per model callRoot span duration
QualityOffline pass rate, groundedness in the human sample, staff acceptance rate of drafted answersEvaluation events, review tool
CostTokens per query, retries per run, cost per resolved queryUsage fields, price table
Safety and governancePolicy denials by rule, redaction failures found in traces, attempted calls to tools outside the task contractPolicy spans, trace audits
Operations and businessQueries resolved without handoff, repeat contact within seven days, escalation rate, time to roll backCase system joined on case reference

Cost per resolved query is the measure that keeps the others honest. It moves when either cost or resolution moves. Suppose spend stays flat while the share of queries resolved without handoff falls from 75% to 60%. Cost per resolved query rises by 0.75 ÷ 0.60 = 1.25, a 25% increase, with no change on the token bill. A cost dashboard alone would show nothing wrong.

Set thresholds with the service owner and write down the action each triggers; SLOs and error budgets in plain English explains how.

Close the loop: from failure to test case

Every confirmed failure, whether from a complaint, a review, a policy alert or an incident, becomes an offline test case with the expected behaviour written down. The fix is a new bundle that passes the full set and the canary. Every incident becomes a test case covers writing cases without copying personal information.

For Swartberg, that meant a test case for the scan question, an index rebuild without the superseded schedule, and a monitor that alerts when an answer cites a passage older than the current benefit year. The monitor would have caught the problem on day one.

The South African version

Three local conditions shape the build.

  • Health information in traces. Under section 26 of the Protection of Personal Information Act (POPIA), health information is special personal information, with a general prohibition on processing subject to the exceptions in the Act. A trace that copies a member's question about a diagnosis is a copy of that information in another system, often a hosted one. Record references, redact, set retention and control access. This is general information, not legal advice; confirm your position with your privacy officer.
  • Small operations teams. Automate the offline gate and the scorecard first, because they run without anyone remembering to. Keep human review small but daily.
  • Cost in foreign currency. Model usage is often billed in US dollars while budgets are set in rand. Store the price table version with the cost estimate in each trace, so a currency or price change does not look like a behaviour change.

AgentOps build checklist

  • The trace records requested and served model, agent version, release bundle, prompt and policy versions, tool calls, tokens and cost.
  • Retrieval evidence is stored as references: data source, index version, passage identifiers and scores.
  • Field names follow the OpenTelemetry generative AI conventions where they exist, with the implemented version pinned.
  • Content capture is off by default; any exception has a documented purpose, redaction and retention.
  • The offline set is versioned with the bundle, and the pipeline blocks a release without a current evaluation run.
  • Canaries compare canary with control, run one at a time and have a written rollback threshold.
  • Whole-bundle rollback is one action and is timed in staging every release.
  • The six-group scorecard is produced per bundle and includes cost per resolved query.
  • Every confirmed failure becomes an offline test case before the fix ships.

What this part adds to the Production Readiness Scorecard

Part 1 introduced the Production Readiness Scorecard, with each domain rated not assessed, hypothesis, tested or operating. This part supplies the evidence for four rows.

DomainEvidence this part producestested meansoperating means
EvaluationVersioned offline set, regression thresholds, human review sample, canary comparisonGate blocked at least one bad bundle in stagingGate runs on every change; review sample is daily and feeds new cases
ObservabilityTrace schema with versions, evidence references, cost and evaluation eventsA complaint can be traced to bundle, model and passages in under an hourScorecard published per bundle; content capture audited
OperationsRollback procedure, on-call alerts from online monitors, failure-to-test-case pipelineRollback timed in stagingRollback used or rehearsed in production; incidents produce cases
EconomicsCost per resolved query and tokens per query, per bundleBaseline measured on canaryBudget thresholds trigger a named action

Next: Part 9, Resilience when the cloud goes quiet: four tabletop exercises. Previous: Part 7, Deploy and scale AI without confusing the layers. All parts are on the series page.

How CloudNala can help

CloudNala builds the AgentOps plumbing for teams taking an agent from pilot to production. We design the trace schema against the OpenTelemetry generative AI conventions, wire evaluation results into the same store, set up the offline gate and a canary with a written rollback threshold, and build the six-group scorecard per release bundle. You leave with a pipeline in which no prompt, policy or model change reaches users without evidence, and a trace that can answer a complaint in an hour rather than a week.


Work with CloudNala

CloudNala helps organisations move from technology ambition to practical execution across cloud, AI, data, platform engineering and digital services.

Whether you are exploring AI, modernising your cloud environment, building a public-sector digital service, or turning an idea into a working MVP, we can help you shape the roadmap and deliver the next step.

Book an AgentOps Engineering Review or write to us at consult@cloudnala.co.za

Found this useful?

Share