Production LLM applications need more than uptime monitoring. This guide defines the observability metrics that reveal where an AI workflow is slowing down or failing, then turns them into a practical dashboard, review cadence, and investigation process.
Overview
LLM observability is the practice of recording enough structured information to understand an AI request from start to finish. A useful monitoring system connects the user’s request to model calls, retrieval steps, tool calls, safety checks, output validation, and the final response.
The goal is not to collect every possible event. It is to create a dependable explanation for changes in user experience, reliability, cost, and answer quality. Metrics should be segmented by application route, model, provider, prompt version, tenant, region, and request type where those dimensions are safe and useful to retain.
A dashboard is most valuable when it supports a decision. For example, a rise in end-to-end latency should lead an engineer toward a particular trace segment, rather than prompting a general inspection of every service. Keep metric definitions stable, record changes to prompts and models, and avoid setting universal alert thresholds before you understand your application’s normal operating range.
What to track
The following metrics form a practical baseline for monitoring a production LLM application.
| Metric | Definition | Why it matters | Useful dimensions |
|---|---|---|---|
| Time to first token | Elapsed time from request acceptance until the first streamed output token is available. | Shows how quickly the application begins responding, especially in streaming interfaces. | Model, route, prompt version, queue time, retrieval enabled |
| End-to-end latency | Elapsed time from request acceptance until the response and required post-processing are complete. | Captures the full user-visible duration, including retrieval, tools, retries, and validation. | Request type, model, tool usage, output length |
| Tool-call failure rate | Failed, timed-out, rejected, or invalid tool calls divided by attempted tool calls. | Separates orchestration problems from model-generation problems. | Tool name, error class, retry count, model |
| Retrieval latency | Time spent querying, filtering, reranking, and preparing retrieved context. | Helps identify slow knowledge access and delays before generation begins. | Index, query type, result count, reranker |
| User feedback | Explicit ratings, correction events, abandonment, escalation, or other defined product signals. | Provides evidence about usefulness that technical metrics cannot measure alone. | Use case, cohort, answer type, prompt version |
| Trace coverage | Percentage of eligible requests with a complete trace across the important workflow stages. | Indicates how much of the system can be investigated when something changes. | Route, deployment, service, sampling policy |
Track token usage and estimated spend alongside these signals when cost is a product or operational constraint. Also record outcome fields such as validation status, refusal category, citation presence, and whether a human review was required. These fields should support governance without storing unnecessary user content.
Recommended trace fields
A trace should have a stable request identifier and a parent-child relationship between workflow steps. Example fields include:
- Request context: trace ID, route, tenant or workspace identifier, region, environment, and application version.
- Model context: provider, model identifier, prompt version, response format, temperature or equivalent generation settings, and token counts.
- Retrieval context: index identifier, query mode, number of candidates, reranking status, and retrieval duration.
- Tool context: tool name, arguments schema version, duration, result status, retry count, and error class.
- Outcome context: validation result, safety or policy decision, user feedback, escalation status, and response completion reason.
Do not place raw secrets, access tokens, or unrestricted sensitive text in traces. Apply redaction or hashing where possible, and define retention rules before enabling detailed logging. The PII redaction guide and AI governance checklist provide related controls.
Instrumentation pattern
The exact SDK differs by platform, but the data model can remain consistent. A simplified Python-style pattern looks like this:
with tracer.start_as_current_span("llm.request") as span:
span.set_attribute("app.route", route)
span.set_attribute("prompt.version", prompt_version)
span.set_attribute("model.name", model_name)
with tracer.start_as_current_span("retrieval") as retrieval_span:
documents = retrieve(query)
retrieval_span.set_attribute("retrieval.result_count", len(documents))
with tracer.start_as_current_span("model.call") as model_span:
response = generate(prompt, documents)
model_span.set_attribute("llm.input_tokens", response.input_tokens)
model_span.set_attribute("llm.output_tokens", response.output_tokens)
span.set_attribute("response.validation", validate(response.text))Use a tracing standard or vendor-neutral export format when practical, but verify field names, sampling behavior, and export support in the tools you operate. Instrumentation examples should be reviewed as dependencies and SDKs change.
Cadence and checkpoints
Use several review horizons rather than relying on one dashboard visit.
Per request
Capture the trace, outcome, duration, token counts, and error state. This is the level used for incident investigation and individual support cases. Sampled traces can reduce storage, but preserve enough complete traces to explain important routes and failures.
Daily operational check
Review request volume, error rate, time to first token, end-to-end latency, tool failures, retrieval latency, and trace coverage. Compare by route and model instead of relying only on an aggregate number. Look for missing data as well as degraded data.
Weekly service review
Use a short worksheet:
- Which metrics changed materially from the previous period?
- Which routes, models, tools, or prompt versions contributed most?
- Did user feedback move in the same direction as technical performance?
- Were any traces unavailable, incomplete, or incorrectly attributed?
- Which change should be tested, rolled back, documented, or assigned for follow-up?
Monthly or quarterly review
Recheck metric definitions, dashboards, retention, sampling, access controls, and dashboard ownership. Review whether new workflow stages have been added without instrumentation. Reconcile model and prompt version inventories with what appears in production traces. This is also a suitable point to update SDK examples and confirm that exported fields still match the team’s reporting needs.
How to interpret changes
Investigate correlated signals before changing prompts or models. The table below provides starting points, not universal diagnoses.
| Observed symptom | First investigation | Possible next check |
|---|---|---|
| Time to first token rises, but generation time is stable | Inspect queueing, request admission, retrieval, and provider connection time. | Compare traffic level, region, model, and retrieval-enabled requests. |
| End-to-end latency rises with retrieval latency | Inspect query volume, index health, result count, and reranking duration. | Test a representative query set and compare retrieval settings. |
| Tool failures rise while model latency is unchanged | Group failures by tool and error class. | Check schema versions, authentication, downstream availability, and retry behavior. |
| User feedback worsens with stable latency | Compare prompt version, model, retrieval quality, and validation outcomes. | Review sampled traces for missing context, unsupported claims, or formatting failures. |
| Trace coverage falls suddenly | Check deployment changes, sampling configuration, exporter health, and permissions. | Compare application request counts with trace ingestion counts. |
| Token usage rises without more traffic | Inspect input context size, retrieved documents, conversation history, and output length. | Review prompt changes and apply the cost workflow described in the LLM app cost optimization guide. |
Keep prompt and model changes attributable. Store their versions with each trace, then use a repeatable evaluation workflow before promoting changes. The guides on prompt version control and prompt testing frameworks can support that process.
When to revisit
Revisit this monitoring plan on a monthly or quarterly cadence, and immediately after a significant workflow change. A new model, provider, retrieval index, tool, prompt version, streaming implementation, or privacy control can change the meaning of existing metrics.
Use this practical checklist at the next review:
- Confirm that every production route emits a trace or has a documented reason not to.
- Verify that time to first token and end-to-end latency use consistent start and end points.
- Check that tool and retrieval spans are linked to their parent request.
- Compare dashboard aggregates with a sample of raw traces.
- Review whether user feedback is being collected consistently and interpreted cautiously.
- Remove sensitive fields that are not needed for diagnosis and confirm retention settings.
- Record open investigation items, owners, evidence, and the next review date.
A mature LLM observability dashboard is not a fixed list of charts. It is a shared operating procedure: define the signals, preserve trace context, compare changes by meaningful dimensions, and connect each anomaly to a repeatable investigation. Recheck the procedure whenever the application changes, so the dashboard remains useful when the next production issue arrives.