Logs, Metrics, and Traces

Observe what the application actually did

Observability is the ability to understand a system's internal behavior from its outputs. Three common signals are logs, metrics, and traces. A log records an event. A metric is a numeric measurement aggregated over time. A trace follows one request across its steps.

An LLM is a large language model. An LLM request may pass through authentication, retrieval, prompt construction, model inference, and output validation. Give the request a unique trace ID so events from those steps can be connected even when many users act at once.

Useful trace fields include timestamp, trace ID, model version, input and output token counts, estimated cost, latency, status, retrieval IDs, and prompt-template version. Store structured JSON rather than prose that requires fragile parsing.

Analogy: A parcel tracking number connects warehouse scans into one journey. Without it, a pile of timestamps cannot explain where your particular parcel waited.
Warning: Observability is not permission to copy sensitive prompts, personal data, API keys, or authorization headers into logs. Prefer metadata, hashes, redaction, access control, and short retention.