Part I — Operational evidence
Questions observability must answer
Start with a concrete operational question. For a bad result, engineers usually need to ask: Which task and attempt produced it? Which components, model calls, retrievals, tools, retries, and asynchronous jobs participated? What information and configuration influenced each decision? Which effects were requested, attempted, confirmed, or left uncertain? How much elapsed time and expense belonged to the attempt? Which claims are directly recorded, which are derived from records, and which remain unavailable?
Question-to-evidence contract
| Question | Useful evidence | What it does not establish |
|---|---|---|
| What executed? | Task and attempt IDs; spans; events; tool-call records | Uninstrumented work or why a model chose an output |
| What influenced it? | Input references; retrieved evidence; code, model, prompt, schema, policy, and configuration identities | Undisclosed provider state or correctness of the inputs |
| What effect occurred? | Operation ID; target-system receipt; authoritative state read; settlement or application acknowledgment | Human understanding or reversal of an already completed effect |
| Where did time and cost go? | Request-level timing relationships; provider usage; paid-tool records; applicable prices | Causation from aggregate correlation or missing provider usage |
| Was the outcome good? | Task-specific checks, human review, or authoritative downstream outcomes | A conclusion from transport success or an error-free span alone |
This boundary prevents a common category error. A span with status “OK” says that the instrumented operation completed according to that instrumentation. It does not say the model grounded its answer, selected the intended tool, respected a business rule, or helped the user. Conversely, a later user correction may show that an outcome was bad without identifying which component caused it. Observability supplies the execution evidence; evaluation and authoritative outcome checks supply the criteria by which that execution is judged.
From isolated records to executions
Software observability developed around a recurring distributed-systems problem: a symptom can appear far from its source. A slow page may reflect a browser resource, an upstream service, a queue, or a dependency changed several calls earlier. Local logs show what one process reported. Aggregate metrics reveal that a population changed. Neither necessarily connects the operations that produced one affected request.
Selected turning points
| Date | Development | Contribution |
|---|---|---|
| July 1998 | NetLogger | Used a common event format to follow data through application, operating-system, and network components. |
| 2007 | X-Trace | Propagated a task identifier across application and network layers to connect reports into a task tree. |
| April 2010 | Dapper report | Described production tracing based on shared-library instrumentation and adaptive sampling at Google. |
| May 2019 | OpenTelemetry announced | Merged OpenTracing and OpenCensus work to reduce incompatible instrumentation and duplicated integrations. |
| November 2021 | W3C Trace Context | Standardized portable HTTP trace-parent propagation across tracing implementations. |
| 2023 | OpenCensus transition | OpenTelemetry reported feature parity in several languages and scheduled most OpenCensus repositories for archival. |
These mechanisms accumulated rather than replacing one another. Metrics remain efficient for detecting population changes; events retain local detail; traces connect operations. AI applications extend the execution record with model identity, prompt and agent versions, retrieved context, token usage, tool calls, and generated content when policy permits. LinkedIn, for example, described rich pre-production inspection and leaner production OpenTelemetry spans for model calls, tool invocations, and memory use—an illustration of capture detail changing with operating constraints, not a universal architecture.
Part II — Representing one execution
Traces, spans, events, and links
A trace correlates operations belonging to one logical execution. A span records one operation with an identity, start and end times, and optional attributes, events, status, and links. A span event marks an instant—such as a retry decision—inside or alongside duration-bearing work. A trace ID identifies the trace; a span ID identifies one operation; a parent span ID expresses a parent-child relationship. These identities describe telemetry structure, not business authority.
Parent-child relationships work when one operation starts or contains another causal continuation. Span links are better when strict nesting would misrepresent the relationship: a batch consumer may process messages from several producers, or a delayed job may begin in a new trace after the originating request ends. Messaging conventions therefore use links to associate consumer work with message-creation contexts. A separate application correlation ID can join several traces or requests into one order, conversation, or workflow, but it does not turn them into one trace.
This structure is a dependency graph, not necessarily a call stack or total timeline. Concurrent retrieval and model work can overlap. A queue can delay consumption. A retry creates another attempt. Different hosts can disagree about wall-clock timestamps, so communication relationships—send before receive, response before client receipt—can constrain order more reliably than sorting all timestamps together. Temporal overlap alone proves neither parentage nor causation.
One task across synchronous and asynchronous work
ExampleA logical task can contain nested calls, linked asynchronous work, and an opaque boundary; one parent tree is not always an honest representation.
Read the diagram as text
- Application request. Logical task attempt entering the application.
- Retrieval. Returns evidence identifiers and selected content references.
- Model boundary. The application records the request and response, but provider internals are opaque.
- Tool proposal. A model output becomes a validated action request.
- Queued message. Carries message identity and propagated creation context.
- Delayed consumer. Starts asynchronous work linked to message creation.
- Authoritative effect. Target-system evidence confirms the defined effect boundary.
- Application request → Retrieval: invokes.
- Retrieval → Model boundary: evidence data.
- Application request → Model boundary: invokes.
- Model boundary → Tool proposal: proposes.
- Tool proposal → Queued message: creates message.
- Queued message → Delayed consumer: async trace link.
- Delayed consumer → Authoritative effect: effect confirmation.
What each signal preserves
An event or structured log preserves an individual occurrence: a policy rejection, a provider response, a queue delivery, or an effect receipt. A metric aggregates numerical observations into streams over time. A trace preserves relationships among operations in a particular execution. Shared trace and span identifiers can correlate logs with execution context, while resource fields identify the emitting service or infrastructure.
Metric forms
- Counter — Accumulates occurrences, such as attempts or failures. Interpret its rate over a stated interval and account for resets.
- Gauge — Records a current absolute, non-additive value, such as queued work or occupied capacity. Use an asynchronous observable gauge when the value is obtained through an accessor rather than delivered as a change event.
- Histogram — Places observations into compatible buckets while retaining count and sum, allowing aggregation before estimating fleet percentiles.
- Exemplar — Associates a selected observation with trace context so an aggregate point can lead to an execution. It is selected evidence, not a representative sample by default.
Every distinct metric label set creates another time series. Request IDs, user IDs, arbitrary prompt text, and tool arguments can therefore make series counts grow with traffic. Keep metric dimensions bounded—operation, model, provider, deployment, disposition, or a controlled task class—and place request-level identity in protected logs or spans. High-cardinality trace data still has storage and privacy costs; the point is to use the representation suited to the question, not to move unlimited data elsewhere.
| Signal | Preserves | Typical question | Main loss or risk |
|---|---|---|---|
| Event or log | One occurrence and local fields | What did this component report? | Relationships require explicit correlation; payloads may be sensitive. |
| Metric | Aggregate values over a population and interval | Did rate, latency, usage, or saturation change? | Individual execution detail is aggregated away. |
| Trace | Relationships and timing within selected executions | Which path and dependencies produced this attempt? | Sampling, missing spans, and instrumentation gaps limit completeness. |
Part III — Capturing interpretable evidence
Record meaning-changing boundaries
Model invocation
Capture evidence where information changes meaning. Stored conversation messages are not identical to the final model input: a chat template serializes roles and control tokens, retrieval may add passages, a policy layer may remove content, and a gateway may route to another model. Around a model boundary, record the operation and attempt identities, requested and returned model when available, prompt or template identity, ordered input references, relevant generation settings, response disposition, finish or cancellation reason, and provider-reported usage. If content is omitted, redacted, truncated, or stored externally, record that status explicitly.
Retrieval, parsing, and tools
At retrieval and transformation boundaries, preserve the query or query reference, collection and index identity, filters, returned evidence identifiers, ordering, and the parser or transformation result. At a tool boundary, distinguish the model's proposed call from schema validation, authorization, execution, and returned result. Tool name and call ID connect proposal to execution; arguments and results are sensitive opt-in content under current OpenTelemetry conventions. A tool span that finishes successfully only establishes its instrumented boundary.
Effects
External effects need their own evidence. A publisher confirmation can show that a broker accepted a message while saying nothing about whether a consumer processed it. A server response finishing can mean bytes were handed to the operating system, not that a client received or understood them. Record the requested action, stable operation ID, validation and authorization result, attempt, target-system receipt, and—when the claim requires it—an authoritative read or application acknowledgment showing the effect boundary actually reached. If the outcome is unknown, preserve it as unknown; a timeout does not prove that the effect failed.
Boundary record
| Boundary | Before | After | Disposition to preserve |
|---|---|---|---|
| Model | Attempt, requested model, input references, settings | Returned model, output reference, usage | Completed, truncated, cancelled, errored, usage unavailable |
| Tool | Call ID, schema version, proposed arguments | Validated arguments, result reference | Rejected, attempted, completed, timed out, result unavailable |
| External effect | Operation ID, target, authorized intent | Target receipt or authoritative state | Confirmed, failed without effect, or unknown |
Identify the system that ran
A trace becomes interpretable only when it identifies the system that produced it. Record resolvable immutable identities for the deployed code or artifact, agent or workflow, prompt or template, tool and response schemas, retrieval corpus or index, policy bundle, feature-flag assignment, and relevant tenant configuration. For models, separate provider, requested model, returned model, immutable snapshot or fine-tune where available, and routing layer. A model family or moving alias does not identify a deployment.
OpenTelemetry schema URLs provide one useful pattern: a versioned, immutable schema identity travels with telemetry groups so a schema-aware consumer can translate supported attribute changes. This helps distinguish a renamed field from changed system behavior. It does not identify code, prompts, models, policies, or business-data schemas; those remain application responsibilities. Likewise, an identifier does not prove that its artifact remains retrievable or that emitted values conformed to it.
The release identity chapter explains why source commits, packaged code, configuration, schemas, dependencies, and model selection can all be release artifacts. Evaluation manifests preserve the system and assessment used in an evaluation. A production trace should link to compatible identities, but it is not itself an evaluation manifest. Provider internals that cannot be observed should remain explicitly unavailable instead of being reconstructed from a product label.
Propagate context and observe telemetry
Context propagation carries trace and parent-span identity across a process boundary. With W3C Trace Context, a sender injects a traceparent header and a receiver extracts it so downstream spans join the same trace. Custom protocols and message envelopes need equivalent injection and extraction. Without propagation, two fully instrumented services can emit valid but disconnected traces. In an MCP demonstration, client context was carried through protocol metadata and restored by a controlled server so the backend could reconstruct the parent relationship; a third-party server outside the administrative domain remained opaque in that setup.
OpenTelemetry baggage carries application-defined properties with a distributed request. It is separate from trace identity and becomes a log, span, or metric attribute only when instrumentation copies it. Because baggage can cross process boundaries, keep it bounded, clear it before untrusted boundaries when appropriate, and never treat it as authorization. A tenant or workflow label carried in baggage is correlation context, not proof that the caller may access that tenant or workflow.
Telemetry integrity
The evidence pipeline is another distributed system. Application SDK queues can fill and drop spans. Collectors can retry and buffer exports, yet still lose records after capacity or retry limits are exhausted. Tail samplers can evict buffered traces, receive late spans after a decision, or make inconsistent decisions when related spans reach different collector instances. OTLP retries can duplicate telemetry when an acknowledgment is lost. Record queue occupancy, export failures, dropped and truncated records, sampling policy, collector and instrumentation versions, and schema identity. A quiet dashboard without these health signals is ambiguous.
Part IV — Reconstruction and diagnosis
Build a defensible execution account
Reconstruction begins with identity: the business task, attempt, trace or traces, provider requests, queue deliveries, tool calls, checkpoints, and external operation IDs. Join records through explicit parentage, links, call IDs, message identities, and application correlation fields. Use timestamps as observations from particular clocks, not as a universal total order. Communication and dependency relationships can constrain ordering when host clocks disagree.
Evidence status
| Status | Meaning | Example |
|---|---|---|
| Observed | A retained record directly states the fact within its instrumentation boundary. | Tool attempt call-7 carried quantity 1000. |
| Derived | A rule combines observed records without adding an unobserved event. | The consumer work followed message creation because the recorded link connects them. |
| Hypothesis | A testable explanation is consistent with current records but not established. | The parser change caused the wrong argument. |
| Unavailable | Required evidence was not captured, was lost, or lies outside the observation boundary. | The third-party service's internal steps are unknown. |
For agents, a trajectory is the ordered observations, selected actions, and results from one task attempt. A trajectory can be represented through spans and events, but generated reasoning text should not be treated as a faithful causal account of model computation. Experiments have shown models rationalizing answers while omitting input features that influenced them. Recorded inputs, actions, and outcomes show what was observed; controlled interventions test a causal explanation.
A runtime checkpoint is another evidence source, not a magical replay of the world. It can identify saved graph state, pending tasks, or a machine snapshot. Historical replay may re-execute later model calls and APIs, producing different results or repeated external effects. The runtime chapter owns persistence and recovery; for observability, the requirement is to record checkpoint identity and distinguish reading saved evidence from executing work again.
Find the consequential divergence
Begin with the affected outcome and its execution identity. First check whether the evidence path is complete enough for the proposed investigation: propagation, sampling, exporter health, content availability, and version context all matter. Then reconstruct the path and compare it with an explicit expectation or a successful execution under comparable conditions. Align equivalent stages rather than comparing arbitrary neighboring timestamps.
Investigation sequence
Each step narrows what the records can support before the investigation makes a causal claim.
- Identify the affected attempt — Connect the reported outcome to its task, attempt, trace, provider request, tool call, and external operation identities.
- Check evidence coverage — Determine whether propagation, sampling, export, content capture, and version records are complete enough to answer the question. Mark missing evidence instead of treating silence as normal behavior.
- Reconstruct dependencies — Order recorded operations using parent relationships, links, messages, and effect confirmations rather than timestamps alone.
- Align a comparable execution — Match equivalent stages from a successful execution or an explicit expected path so differences in workload or structure do not masquerade as faults.
- Locate the first supported material difference — Find the earliest recorded divergence capable of explaining the downstream outcome, while keeping correlation distinct from causation.
- Test competing explanations — Choose an observation or controlled change that could reject each remaining hypothesis.
Inspect boundaries separately: input assembly, retrieval, provider response, parsing, policy, tool selection, state, external effect, and infrastructure. Suppose a tool received an excessive quantity and executed it. The final tool call establishes where the effect was attempted, but adjacent records may show that an upstream model constructed the bad argument. In larger systems, a subtle earlier error can propagate through many prompts and tools, so the final failing interaction need not identify the component to change.
Align executions to find the first material difference
ExampleThe final bad effect can be downstream of an earlier recorded divergence; locating that difference narrows the investigation but does not by itself prove causation.
Read the diagram as text
- Comparable input. A successful attempt begins with the matched task conditions.
- Retrieved evidence. The comparable attempt records the selected evidence identifiers.
- Proposed quantity: 10. The model boundary directly records the proposed tool argument.
- Validation passed. The recorded schema and policy checks accepted quantity 10.
- Tool attempted 10. The tool boundary records the validated quantity it received.
- Expected effect confirmed. Authoritative target-system evidence confirms the defined effect boundary.
- Affected input. The bad attempt begins with task conditions matched to the comparable execution.
- Retrieved evidence. The affected attempt records the same selected evidence identifiers.
- Proposed quantity: 1000. This is the first recorded material difference between the aligned stages.
- Validation passed. The recorded checks accepted the excessive quantity; whether a missing rule caused the outcome remains a hypothesis.
- Tool attempted 1000. The tool executed the validated argument it received; this is downstream evidence, not automatic proof of the originating defect.
- Wrong effect confirmed. Authoritative target-system evidence confirms that the unintended item was changed.
- Controlled causal test. Replay a captured boundary or change one relevant rule while holding the comparison conditions fixed.
- Hypothesis disposition. A changed downstream outcome supports the tested explanation; an unchanged outcome rejects or weakens it.
- Comparable input → Retrieved evidence: assembles request.
- Retrieved evidence → Proposed quantity: 10: informs proposal.
- Proposed quantity: 10 → Validation passed: submits quantity 10.
- Validation passed → Tool attempted 10: authorizes attempt.
- Tool attempted 10 → Expected effect confirmed: receives confirmation.
- Affected input → Retrieved evidence: assembles request.
- Retrieved evidence → Proposed quantity: 1000: informs proposal.
- Proposed quantity: 1000 → Validation passed: submits quantity 1000.
- Validation passed → Tool attempted 1000: authorizes attempt.
- Tool attempted 1000 → Wrong effect confirmed: receives confirmation.
- Proposed quantity: 1000 → Controlled causal test: defines tested change.
- Controlled causal test → Hypothesis disposition: produces observation.
The earliest consequential divergence is the first supported difference capable of explaining downstream behavior—not merely the first unusual value or earliest timestamp. Correlation generates hypotheses; it does not prove root cause. Use a controlled change or a fixed replay boundary to distinguish explanations. Replay can hold a captured provider response fixed while exercising downstream code. Falsifiable debugging experiments determine what observation would reject each proposed cause.
Part V — Time, cost, and outcomes
Attribute elapsed time
Define the observation boundary before naming a latency. End-to-end client latency, server operation duration, queue time, model prefill, time to first response chunk, server time to first token, generation duration, inter-token latency, network transfer, and client-visible completion are different intervals. Current OpenTelemetry generative-AI metrics distinguish client time to first response chunk from server time to first token; chunks and tokens are not one-to-one, and the observation points differ.
A critical path is the longest weighted dependency path controlling completion. Total work is the sum of work across operations. If retrieval and model preparation overlap, their durations both contribute work but their overlap is counted once in elapsed wall time. The slowest individual span is not necessarily the critical path, and subtracting overlapping child durations independently from a parent can produce nonsense. Trace relationships and interval unions are required.
Elapsed latency is not summed span time
Example timingsOverlapping span durations describe concurrent recorded work and must not be added to obtain wall-clock latency.
Read the diagram as text
- Request. End-to-end server observation boundary. 0 to 120 ms; duration 120 ms.
- Retrieval. Evidence lookup overlaps the model operation. 5 to 35 ms; duration 30 ms. Parent: Request.
- Model operation. Includes processing before and after response onset. 10 to 80 ms; duration 70 ms. Parent: Request.
- Response streaming. First response chunk appears at its start. 40 to 75 ms; duration 35 ms. Parent: Model operation.
- Tool attempt. A recorded tool interval; the timeline does not assert what caused it to begin. 80 to 100 ms; duration 20 ms. Parent: Request.
- Retry attempt. A separate recorded attempt; temporal adjacency alone does not prove dependency. 100 to 115 ms; duration 15 ms. Parent: Request.
- Request finalization. A recorded five-millisecond finalization span inside the parent request. 115 to 120 ms; duration 5 ms. Parent: Request.
Distributions matter. Engaged users issue repeated requests and accumulate exposure to slow tails; voice conversations can be disrupted by a single long pause. Histograms can be aggregated before estimating fleet percentiles, but averaging instance percentiles does not produce a fleet percentile. Component p95 values also cannot be added to obtain end-to-end p95 because the slow observations need not occur on the same requests. Slice latency by operation, dependency, version, workload shape, and outcome disposition before attributing a regression.
Build an attributable cost ledger
Cost attribution starts with execution identity. For each directly metered item, preserve quantity, unit, currency, applicable price reference, request and attempt, dependency, customer or project attribution, and whether the value is provider-reported, independently measured, or estimated. Model records may include input, output, and cached tokens when the provider supplies them; other modalities and reasoning usage require their own supported units. Token counts are not monetary cost until a price rule is applied.
Count attempts, not only successful logical calls. A retry may produce multiple provider calls for one workflow step. Failed attempts, paid tools, discarded branches, and human review can incur cost even when the workflow fails. Avoid double counting when both an application instrumenter and a gateway report the same model request, or when a parent record already contains its children's cumulative expense. Interrupted streams may never deliver a final provider-usage record; mark that quantity unavailable rather than zero and keep separate estimates visibly labeled.
Accounting boundaries
| View | Includes | Interpretation |
|---|---|---|
| Attempt cost | Observed calls and tools for one attempt | Expense incurred by this execution, including failed work when recorded. |
| Workflow cost | Deduplicated attempt and dependency costs across one workflow | Direct cost of the workflow under the stated inclusion rules. |
| Provider cost export | Provider-accounted expense for its service period and grouping | Reconciliation boundary; it may not join to every application request. |
| Allocated shared cost | A stated rule distributing platform, network, storage, or support expense | Organizational allocation, not proof of physical consumption by one request. |
| Cost per useful outcome | Cost divided by independently established useful outcomes | Requires outcome assessment and explicit unresolved handling. |
Keep cost per attempted request, completed workflow, and useful outcome separate. A growing token total may reflect more use, longer contexts, retries, or waste. It does not establish delivered value. Deeper optimization and workload economics belong in AI Cost and Performance Engineering.
Connect operations to outcomes
Monitoring repeatedly measures a defined operational question over an eligible population and period. A service-level indicator specifies what counts as a good event and which events are eligible; a service-level objective gives that indicator a target and period. For AI systems, transport availability can be one indicator, while task completion, tool success, escalation, correction, review duration, latency, cost, safety events, and recovery describe different properties. Do not collapse them into one unexplained health score.
Stable task and attempt identities let later evidence join the execution: a reviewer override, customer correction, escalation, abandonment, dispute, or authoritative downstream result. Define the numerator, denominator, aggregation unit, follow-up window, unresolved disposition, slice, and sampling policy. In a human-reviewed workflow, rising override frequency or review duration can be useful investigation signals, but they are indirect: a long review may reflect confusing output, difficult cases, or a changed reviewer population.
Production outcomes are often delayed or selectively observed. Recent requests have had less time to receive a result. Only escalated cases may receive expert review. Users may report visible failures and remain silent about others. The observed success rate therefore estimates success among observed outcomes, not automatically among all eligible cases. Report successes, failures, and unresolved cases separately; absence of a recorded failure is not success. Incomplete production feedback explains the evaluation consequences.
Aggregate changes also require slicing. A deployment can look worse because it received a harder task mix even when within-slice behavior stayed constant; the reverse can hide regressions. Compare relevant workload, version, provider, model, risk, and disposition slices while preserving denominators and uncertainty. When a causal product decision is needed, use an appropriate live experiment; telemetry supplies exposure and outcome records, but randomization and analysis supply the intervention claim.
Part VI — Evidence under constraints
Sample for the question
Full-fidelity tracing is often impractical, so sampling selects executions for recording or retention. Head sampling decides before the complete trace is known and is efficient, but cannot preferentially retain failures discovered later. Tail sampling buffers most or all of a trace before deciding and can retain executions with errors, high latency, or selected attributes, but it adds state, routing, and operational complexity. Nothing downstream can recover a trace discarded by an earlier sampler.
Sampling changes the supported claim
ExampleUniform and outcome-enriched policies retain different evidence from the same workload, so their retained percentages answer different questions.
All execution types exist before telemetry retention is applied.
Read the diagram as text
- Routine success. A common technically successful execution.
- Common failure. An execution with a recorded error.
- Slow success. A successful execution in the latency tail.
- Rare severe failure. A low-frequency, high-consequence execution.
- Incomplete trace. Late or dropped spans leave uncertain disposition.
- Uniform retained set. Known-probability selection intended for population estimation.
- Failure-enriched set. Retains diagnostic failures but overrepresents them.
- Latency-tail set. Retains slow traces and requires complete routing and buffering.
- Routine success → Uniform retained set: may be selected.
- Common failure → Uniform retained set: may be selected.
- Slow success → Uniform retained set: may be selected.
- Common failure → Failure-enriched set: selected by error.
- Rare severe failure → Failure-enriched set: selected by error.
- Slow success → Latency-tail set: selected by latency.
- Incomplete trace → Latency-tail set: may evade decision.
- Underlying workload. All execution types exist before telemetry retention is applied. Active: Routine success, Common failure, Slow success, Rare severe failure, Incomplete trace. New: Routine success, Common failure, Slow success, Rare severe failure, Incomplete trace.
- Uniform selection. A known-probability sample can estimate population properties, subject to sample size and coverage. Active: Routine success, Common failure, Slow success, Rare severe failure, Incomplete trace, Uniform retained set. New: Uniform retained set.
- Failure enrichment. Error-based retention improves diagnostic availability while changing the represented population. Active: Routine success, Common failure, Slow success, Rare severe failure, Incomplete trace, Uniform retained set, Failure-enriched set. New: Failure-enriched set.
- Tail selection. Tail sampling can retain slow traces but remains vulnerable to incomplete routing, late spans, and buffer limits. Active: Routine success, Common failure, Slow success, Rare severe failure, Incomplete trace, Uniform retained set, Failure-enriched set, Latency-tail set. New: Latency-tail set.
Sampling choices
| Policy | Useful for | Claim it cannot support alone |
|---|---|---|
| Uniform probabilistic | Estimating population properties when inclusion behavior is known and the sample is large enough | Reliable capture of every rare severe failure. |
| Parent-based distributed decision | Keeping child spans aligned with the upstream sampled flag when trace context is propagated and samplers are configured compatibly | Recording or export completeness; propagation can fail and a sampled flag is not a delivery guarantee. |
| Error- or latency-enriched tail | Diagnosing known failures and slow executions | Population error or latency frequency without accounting for deliberate selection. |
| Attribute- or status-selected tail | Retaining executions matching a defined operational condition | The prevalence of that condition in all traffic. |
| Rate-limited retention | Bounding retained telemetry volume | A representative population sample without a separate probability design. |
| Adaptive instrumentation | Allocating capture to changing diagnostic value under a budget | Reconstruction of instrumentation that was disabled at the time. |
| Exemplar | Navigating from an aggregate observation to a selected trace | Evidence that the selected trace is typical. |
Keep separate streams when one policy cannot answer both monitoring and diagnosis. A representative sample can estimate rates; an error-enriched sample can preserve diagnostic detail; bounded escalation can capture sensitive payload evidence for selected incidents. Record the sampling policy and version with retained data. Tail sampling still does not guarantee completeness under buffer eviction, late spans, overload, or upstream head sampling.
Govern telemetry as sensitive data
Telemetry is a governed copy of application data. Prompts, system instructions, retrieved passages, headers, tool arguments and results, model outputs, attachments, conversation identifiers, and user feedback can contain credentials, personal information, confidential material, or regulated records. OpenTelemetry cannot infer what is sensitive in a particular application. Give every captured field a diagnostic purpose, classify it, and decide who may read it and for how long before enabling collection.
Prefer bounded metadata and stable references when raw content is unnecessary. When investigation requires content, store it separately with narrower access and retention where feasible. Redaction before capture prevents the application telemetry path from ever receiving a field. Redaction in a self-deployed collector can prevent it from reaching an external backend, but the field already existed in the application and transport to that collector. Redaction after export leaves another retained copy. These boundaries create materially different exposure.
Redaction must understand structure: headers, nested JSON, tool schemas, streaming fragments, and attachments require different handling. Test likely secrets, partial identifiers, multilingual personal data, encoding changes, and false positives that destroy diagnostic value. Hashing predictable identifiers does not automatically anonymize them because candidate values may be enumerable. Minimization is therefore a field, precision, recipient, and lifetime decision—not a one-time text substitution.
Inventory all copies through data-flow governance: application buffers, collectors, observability backends, external content stores, derived metrics, evaluator records, support tools, exports, and backups. Give metadata and payload evidence separate access rules where appropriate. Set artifact-specific retention with a clock-start event, expiry or review condition, disposal action, and accountable owner. Auditability is not permission to keep everything indefinitely.
Keep observability from failing the service
Observability consumes resources: instrumentation CPU and memory, serialization, network egress, collector queues, ingestion, indexing, storage, queries, evaluator records, and engineer review. Agent traces can contain large semi-structured text payloads and need both immediate per-trace inspection and aggregate analysis. Reported unusually large examples show the possible systems problem, not a typical trace size. Measure your workload rather than inheriting an anecdotal budget.
Bound metric cardinality, attribute and payload size, trace depth, queue capacity, batch size, and retention. Truncation can preserve pipeline availability while sacrificing evidence; expose truncation counters and diagnostic status. Batch export reduces per-record overhead but bounded queues can still drop data, and a flush request can fail or time out. Instrumentation callbacks should avoid blocking the application path; exporter failure policy must be explicit rather than accidentally determined by a full queue.
Instrumentation decision record
| Decision field | Question to answer |
|---|---|
| Operational purpose | Which investigation, alert, attribution, or governance decision uses this signal? |
| Fidelity and coverage | What is captured, sampled, truncated, derived, or unavailable? |
| Volume and cardinality | How do traffic, branches, labels, and payload size change cost? |
| Sensitivity | Does it contain identity, prompts, retrieved content, arguments, results, or secrets? |
| Retention and access | Who may inspect it, for what purpose, and until which event or date? |
| Failure behavior | Can collection block user work? Which losses, delays, retries, and truncations become visible? |
| Owner | Who maintains semantics, budgets, alerts, access, and deletion behavior? |
A useful observability system can say both “this is what the evidence establishes” and “this evidence is incomplete.” It preserves enough identity and structure to reconstruct consequential executions, enough aggregation to detect population changes, and enough integrity telemetry to reveal when those conclusions are no longer justified. More records are valuable only when they improve a decision enough to justify their runtime, financial, and privacy costs.
Open questions
How can teams verify end-to-end instrumentation coverage when providers, queues, tool servers, and client applications expose different semantics? Progress would include coverage manifests, conformance tests, and explicit unavailable regions rather than inferred completeness.
What common cost record could reconcile model modalities, paid tools, retries, discarded branches, shared infrastructure, mutable prices, currencies, and human review without double counting? Progress would preserve each accounting boundary and measured-versus-estimated status instead of forcing one unsupported total.
How can rare severe failures be retained for diagnosis while telemetry still supports unbiased population estimates? Progress would combine known-probability monitoring samples with bounded diagnostic escalation and report selection policies alongside every quantitative claim.
How can content-rich agent traces remain diagnostically useful under strict minimization and deletion requirements? Progress would provide structure-aware redaction tests, separately governed payload evidence, resolvable metadata references, and verified deletion across derived stores and exports.
How can an investigation confirm arbitrary external business effects across systems that do not share one transaction or acknowledgment contract? Progress must come from operation-specific authoritative state, idempotency, and reconciliation interfaces; trace completion alone cannot supply it.





































































































































































































