AI ENGINEERING — LIVING GLOSSARY #021
Lesson 21 of 24 | Chapter 4
PRODUCTION OBSERVABILITY
Monitoring AI Systems Under Real-World Conditions
Chapter 4: Deploying, Scaling, and Operating AI Systems
AIYING — Accomplishing with AI
The Dashboard Is Green. Why Are Users Unhappy?
A financial-services company deploys an AI assistant to help customer-service employees answer policy and account-service questions.
Its operational dashboard looks excellent:
API success rate: 99.7%
Average response time: 1.8 seconds
These are illustrative figures. Yet staff report that the assistant sometimes cites outdated policies, omits important conditions, and gives incomplete answers.
At the same time, inference costs are increasing.
The system is technically available, but its business performance is deteriorating.
How can engineers discover what is happening?
Observability does not guarantee that every error will be detected. It provides the instrumentation and evidence needed to investigate system behavior and improve operations.
↑ Back to contents1. What Is Production Observability?
Production observability is the practice of instrumenting, collecting, correlating, and analyzing operational evidence to understand how a deployed system behaves under real workloads.
For AI applications, that evidence may include:
- Requests, errors, and response times.
- Model calls, token usage, and model versions.
- Retrieval operations and document freshness.
- Tool invocations and agent execution steps.
- Output validation failures.
- Response quality and task-success evaluations.
- User feedback and escalation outcomes.
- Security and policy-control events.
- Operational and inference costs.
The goal is to answer not only “Is the service running?” but also “Is the service accomplishing its intended task reliably?”
Observability is not synonymous with collecting every prompt, response, or customer record. Data collection must be purposeful and governed.
↑ Back to contents2. Why Traditional Monitoring Is Insufficient
Traditional application monitoring commonly emphasizes infrastructure availability, CPU utilization, memory usage, request latency, and error rates.
These remain essential. But a language model can return a successful API response containing an unsupported or outdated answer.
| Technical Signal | What It May Miss |
|---|---|
| HTTP 200 response | Factually incorrect answer. |
| Low latency | Incomplete or irrelevant response. |
| High availability | Outdated retrieval content. |
| Successful tool call | Incorrect business outcome. |
| Low error rate | Unauthorized or unsafe content. |
| Stable CPU usage | Unexpected model token costs. |
Production AI observability must therefore combine conventional service monitoring with task-specific quality measurements.
3. Logs, Metrics, Traces, and Evaluations
A. Logs
Logs record events such as requests, validation failures, tool errors, release changes, and security decisions.
Example: A retrieval service reports that a policy document was last updated six months ago.
B. Metrics
Metrics are numerical measurements aggregated over time.
Examples include p95 latency, request error rate, token consumption, tool success rate, and cost per successful task.
C. Traces
Traces connect operations belonging to a single request or task.
For an AI assistant, one trace might contain spans for authentication, retrieval, prompt assembly, model inference, output validation, and response delivery.
D. Evaluations
Evaluations assess behavior or outcomes against defined criteria.
Examples include factual support, policy-answer correctness, citation accuracy, classification accuracy, and task completion.
Evaluations may use deterministic checks, reviewed reference cases, human assessment, or carefully calibrated model-based judges.
Evaluation results are measurements, not infallible truth. Sampling, evaluator limitations, and changing workloads must be considered.
Logs → What events occurred? Metrics → How much, how often, how fast? Traces → Where did this request go? Evaluations→ Was the outcome acceptable?
4. What Should AI Engineers Monitor?
| Category | Representative Measures |
|---|---|
| Availability | Successful service availability and request outcomes. |
| Latency | Median, p95, p99, time to first token. |
| Model usage | Requests, input/output tokens, model version. |
| Cost | Estimated spend, cost per request, cost per successful task. |
| Retrieval | Latency, failures, source freshness, relevance on reviewed samples. |
| Tool execution | Call counts, failures, timeouts, retries, completion verification. |
| Agent behavior | Steps per task, loops, termination, escalation. |
| Structured outputs | Schema validation and parsing failure rates. |
| Quality | Task success, groundedness, correctness on evaluated samples. |
| Safety | Policy-control outcomes, unauthorized requests, detected injection attempts. |
| User experience | Feedback, abandonment, human escalation. |
Metrics must be defined precisely. For example, "tool success" might mean a successful API response, while "business success" might require confirmation that the requested record was actually updated.
Use both aggregate measures and appropriate segmentation, such as by model version, workflow, region, tenant class, or release cohort.
Do not put raw customer identifiers or sensitive text into high-cardinality metric labels.
↑ Back to contents5. Production Observability Architecture
Real User Request
|
v
AI Application
|
+----------+----------+
| | |
v v v
Retrieval Model Tools
| | |
+----------+----------+
|
v
Response Validation
|
v
User Outcome
Instrumentation throughout:
Logs | Metrics | Traces | Events
|
v
Telemetry Collection
|
+----------+----------+
| | |
v v v
Dashboards Alerts Quality Evals
| | |
+----------+----------+
|
v
Investigation & Action
|
v
Fix / Revert / Improve
Correlation identifiers
Assign a trace or request identifier so engineers can connect the relevant operations without exposing unnecessary personal information.
Release metadata
Track application version, model version, prompt version, and retrieval configuration where applicable.
Telemetry pipeline
Use a suitable collection and processing pipeline, such as one built on OpenTelemetry-compatible instrumentation.
Dashboards and alerting
Present important indicators and trigger alerts when defined conditions are violated.
Evaluation pipeline
Assess representative production samples where permitted, supplemented by synthetic tests and reviewed reference datasets.
↑ Back to contents6. The Operational Feedback Loop
- Instrument: Identify important operations, outcomes, and failure conditions.
- Collect: Gather appropriate telemetry and evaluation evidence.
- Detect: Identify anomalies, threshold breaches, or quality regressions.
- Investigate: Correlate traces, logs, metrics, and evaluation results.
- Respond: Mitigate, disable, revert, or repair the affected component.
- Verify: Confirm technical recovery and restoration of acceptable task quality.
- Improve: Update tests, controls, runbooks, and future release criteria.
This creates a feedback loop between production experience and engineering decisions.
7. Service-Level Indicators and Objectives
A service-level indicator (SLI) is a defined measurement of service behavior.
A service-level objective (SLO) is a target for an SLI over a specified period.
Illustrative technical SLO
At least 99.5% of eligible assistant requests complete successfully within the defined measurement window.
Illustrative latency SLO
At least 95% of eligible interactive requests complete within five seconds over a rolling seven-day period.
Illustrative quality objective
At least 95% of a defined, reviewed sample of policy-answer responses satisfy the organization's correctness criteria.
These are teaching examples, not universal targets.
Quality objectives require a clear evaluation method, sampling strategy, and awareness of uncertainty. A quality score computed from 20 samples is not equivalent to a reliable population-wide estimate.
Error budgets
For suitable reliability SLOs, teams can calculate an error budget representing the permitted amount of noncompliant service behavior within a measurement window.
Error budgets help teams balance release velocity with reliability. Quality-based budgets require particular care because evaluator results may be noisy or incomplete.
↑ Back to contents8. Alerts and Incident Response
Not every unusual metric should trigger a page to an engineer.
Good alerts should be actionable, relevant, and tied to service risk.
Examples
- Elevated p95 latency sustained beyond the allowed threshold.
- Sudden increase in model API failures.
- Critical tool failures affecting customer workflows.
- Sharp increase in schema validation failures after a release.
- Unexpected token consumption or cost spikes.
- Material decline in quality on a sufficiently evaluated sample.
- Confirmed authorization-control failures.
Incident workflow
Alert or User Report
|
v
Triage Severity
|
v
Identify Affected Cohort
|
v
Inspect Traces & Metrics
|
v
Check Release Changes
|
v
Mitigate / Revert / Repair
|
v
Verify User Outcomes
|
v
Document Lessons
Use separate thresholds and escalation paths for security incidents, technical outages, and quality regressions.
Where possible, alert on symptoms that affect users rather than on isolated infrastructure fluctuations.
↑ Back to contents9. Privacy, Security, and Reliability
Data minimization
Collect only the telemetry needed for legitimate monitoring and investigation.
Prompt and response handling
Prompts and responses may contain personal, confidential, or regulated information. Use redaction, access controls, retention limits, and appropriate sampling.
Trace security
Protect traces and logs from unauthorized access. Avoid recording secrets, credentials, and unnecessary customer content.
Prompt injection monitoring
Record relevant control outcomes and investigate suspected attacks. Detection systems are imperfect and should not be treated as complete protection.
Evaluator governance
Assess model-based evaluators for consistency, bias, and disagreement with human reviewers.
Monitoring reliability
Telemetry systems can fail. Design for dropped events, collection delays, and incomplete traces.
Cost control
Observability itself consumes resources. Set suitable retention, sampling, and storage policies.
10. Observability vs Related Concepts
| Concept | Primary Question |
|---|---|
| Monitoring | Are predefined indicators within acceptable limits? |
| Observability | Can we investigate and understand system behavior using available evidence? |
| Logging | What events were recorded? |
| Tracing | How did a request move through components? |
| Evals | How well did the system perform a defined task? |
| Incident response | How do we contain, repair, and recover from failure? |
| LLMOps | How do we manage the operational lifecycle of LLM applications? |
Monitoring, observability, and evaluation complement one another. None replaces the others.
Connection to Lesson #011: Earlier, we studied observability as a reliability building block. Here, we extend it into production operating practices, service objectives, alerting, release analysis, and incident response.
↑ Back to contents11. Industry Applications
- Financial services: Track policy-answer quality, access-control failures, and escalation outcomes.
- Customer support: Monitor resolution quality, tool failures, and user abandonment.
- E-commerce: Detect catalog freshness problems and cost spikes during peak demand.
- Software engineering: Trace agent steps, tool execution, and code-change verification.
- Enterprise knowledge systems: Monitor retrieval quality and citation support.
- Document processing: Detect extraction errors, schema failures, and exception rates.
- IT operations: Analyze incident-assistant accuracy and escalation behavior.
Choose measurements according to the application's actual task and risk. Generic dashboards alone cannot establish business success.
↑ Back to contents12. Industry Case: Financial-Services Policy Assistant
Illustrative enterprise scenario, not a documented incident at a named institution.
The business objective
Help customer-service staff answer questions using current, approved internal policies.
Initial symptoms
- Technical availability remains high.
- Employees report outdated answers.
- Some responses omit policy exceptions.
- Token consumption rises after a model-routing change.
Investigation
Step 1 — Identify affected requests. Review appropriately sampled and authorized cases, grouped by release version and policy topic.
Step 2 — Inspect retrieval traces. Check which documents were retrieved, their versions, and whether they were current at request time.
Step 3 — Inspect model calls. Compare prompt version, model routing, input token counts, and output length.
Step 4 — Evaluate answers. Compare responses against an approved reference set, including policy exceptions and edge cases.
Step 5 — Correlate findings. Determine whether the quality regression began after a document-index update, prompt change, model change, or another system event.
Illustrative finding
The investigation discovers two separate issues:
- The retrieval index includes an outdated policy document that was not removed after an update.
- A prompt revision increases context length without improving answer quality, raising token costs.
These are hypothetical findings for the learning exercise.
Corrective actions
- Remove or deprecate the outdated document from retrieval.
- Rebuild and verify the affected index.
- Restore the previously approved prompt configuration if justified.
- Re-run the policy-answer evaluation suite.
- Monitor the affected release cohort after remediation.
- Update document freshness checks and release tests.
Verification
The team confirms that current policy documents are retrieved, reviewed test cases pass, and token usage returns to an acceptable range.
They continue monitoring production feedback because a passing test suite cannot guarantee the absence of every future error.
13. Engineering Design Decisions
- Which user outcomes define success?
- Which technical and quality indicators are most important?
- What telemetry can be collected safely?
- How will requests be correlated across services?
- Which model, prompt, and retrieval versions should be recorded?
- How will representative quality samples be selected?
- What evaluator limitations must be documented?
- Which SLOs are appropriate?
- Which alerts require immediate action?
- Who owns investigation and incident response?
- How will production regressions affect future releases?
- How will observability cost and data retention be controlled?
Decision principle: Instrument what is needed to make reliable engineering decisions, not everything that is technically possible to record.
↑ Back to contents14. Hands-On Mini Project
Project: Build an AI Production Observability Dashboard
Objective: Simulate production telemetry for an AI assistant and detect a quality regression that conventional service monitoring would miss.
No live financial data or paid AI API is required.
Step 1: Create a synthetic dataset
Generate at least 100 fictional request records containing:
- Request ID and timestamp.
- Application release version.
- Model version.
- Retrieval latency.
- Model latency.
- Input and output token counts.
- Request success or failure.
- Evaluation result for a selected subset.
- Estimated request cost.
Step 2: Establish a baseline
Use the first group of records to represent normal operation.
Step 3: Simulate a regression
Introduce an increase in outdated-answer failures after a fictional document-index update, while keeping API success rates high.
Step 4: Create a dashboard
Display:
- Request volume.
- Success and error rates.
- Median and p95 latency.
- Average tokens per request.
- Estimated cost per request.
- Quality pass rate on evaluated samples.
- Results grouped by release version.
Step 5: Add tracing
Create representative trace records linking request, retrieval, model call, and validation events.
Step 6: Define alerts
Specify thresholds for technical errors, sustained latency increases, and quality regression. State how sample size affects confidence.
Step 7: Investigate
Identify the fictional change associated with the quality decline.
Step 8: Prepare an incident report
Document:
- Observed symptoms.
- Affected requests.
- Evidence.
- Likely cause.
- Corrective action.
- Verification results.
- Prevention measures.
Step 9: Reflect
Would a dashboard containing only uptime and latency have detected the simulated problem?
↑ Back to contents15. Evaluation and Acceptance Criteria
| Criterion | Exercise Expectation |
|---|---|
| Telemetry completeness | All required synthetic fields present. |
| Technical dashboard | Request volume, errors, and latency correctly calculated. |
| Quality dashboard | Evaluation pass rate displayed separately from API success. |
| Release comparison | Regression visible by release or index version. |
| Trace correlation | Selected requests can be followed across components. |
| Alert quality | Alerts have documented thresholds and intended actions. |
| Incident diagnosis | Conclusion supported by synthetic evidence. |
| Privacy | No real customer information or secrets included. |
| Recovery verification | Post-fix metrics and quality results compared with baseline. |
Success means detecting and explaining the simulated quality regression—not merely producing attractive charts.
↑ Back to contents16. Connected Glossary Terms
- #007 — Evals: Provide structured evidence of AI behavior and task quality.
- #008 — Hallucination: Unsupported responses may require quality monitoring.
- #009 — Grounding: Helps evaluate whether answers are supported by sources.
- #010 — Guardrails: Generate control outcomes worth monitoring.
- #011 — Observability: Introduced the foundational concept extended here.
- #013 — Tool Calling: Tool execution and failures can be traced.
- #015 — AI Agents: Agent steps and termination require operational visibility.
- #018 — Structured Outputs: Validation failures provide measurable signals.
- #019 — Deployment: Establishes the production system to be monitored.
- #020 — Scalability: Requires visibility into load, latency, and bottlenecks.
Previous lesson: #020 — Scalability.
Next lesson: #022 — Cost Optimization: Engineering AI Systems for Sustainable Economics.
↑ Back to contents17. Living Update
Editorial baseline: November 2026.
Production AI observability continues to evolve. Engineers should monitor developments in:
- OpenTelemetry semantic conventions for generative AI.
- Distributed tracing across models, tools, and agents.
- Evaluation of production samples.
- Automated regression detection.
- Model-based evaluation reliability.
- Privacy-preserving telemetry collection.
- Cost attribution by task and tenant.
- Integration of quality metrics into release decisions.
- Agent execution and multi-step workflow monitoring.
Check the applicable versions of instrumentation libraries and semantic conventions. Support and stability may differ across implementations.
↑ Back to contents18. Key Takeaway
Understand the Term: Observability connects logs, metrics, traces, and evaluations.
Connect the Technology: Production AI applications need visibility across models, retrieval, tools, workflows, and user outcomes.
Apply the Knowledge: Define indicators that reflect both technical health and task quality.
One Action: Design a dashboard that compares API success rate with evaluated answer correctness. Simulate a release that keeps the API healthy but reduces answer quality.
Think like an AI engineer: If every API request succeeds but users are receiving wrong answers, what signal will tell you?
↑ Back to contents19. References and Further Reading
- OpenTelemetry — Documentation
- OpenTelemetry — Generative AI Semantic Conventions
- Google — Site Reliability Engineering
- Grafana — Documentation
- Prometheus — Documentation
- NIST — AI Risk Management Framework
- OWASP — Generative AI Security Project


