Skip to content

Observability: Metrics, Logs, Traces, and SLOs with OpenTelemetry

11 min reading

Define indicators and evidence boundaries before interpreting service health.

Page details

Design for failure · Lesson 11

Published · Sources · 11 min reading · Last edited:

Know first: Numbers Every Engineer Should Know; Reading Architecture Diagrams.

Editorial correction:

Earlier design notes used unsupported universal performance or reliability claims. This revision explains conditional mechanisms and explicitly hypothetical examples; no author-run benchmark or production incident is asserted.

More
20px

Northwind: Observability: outcomes, evidence, and measurement limits

Outcome. After this lesson, you can follow a checkout through OpenTelemetry.

Hypothetical scenario. At Northwind, Sam needs to connect a slow checkout to a specific dependency.

In short. Use traces for causality and metrics for service outcomes. Carry correlation through each remote handoff.

Success on the server, failure for the user

Hypothetical scenario. A reservation service reports healthy database latency while buyers complain that confirmations never arrive. The write commits, but a downstream consumer is stuck. The request endpoint's success counter and the user's completed journey now describe different things.

Observability begins with the question the evidence must answer. Did the service accept a request, commit the intended effect, complete the workflow, or present the result to the caller? Each boundary can succeed while a later one fails. A large volume of telemetry does not make those boundaries equivalent.

The preceding chapter introduced stable logical operation identity across retries. This chapter uses that identity to connect evidence while preserving the difference between a business operation, an attempt, a span and a stored result. The outcome is a measurement design that makes its blind spots explicit.

A green average hides the affected path

A mean combines fast and slow requests and can conceal a small affected tenant or operation. An overall success ratio can also improve when the failing path stops receiving traffic. Define the eligible population before interpreting a favorable aggregate.

Internal health is necessary evidence but not the whole user outcome. A process can answer a health probe while lacking permission to publish events. A queue can accept messages while completion falls behind. A service can return a response quickly because it incorrectly rejected valid work.

Start from the journey and enumerate the stages that establish its outcome. Then ask which measurements detect a broken stage, which merely suggest a cause, and which independent evidence can distinguish failure from a broken telemetry pipeline. Avoid a dashboard whose only evidence of health comes from the component being investigated.

Connect outcomes to supporting evidence

Metrics summarize defined populations over time; logs record selected events; traces relate instrumented operations across services. None is inherently a complete audit of business effects. Preserve authoritative operation state for reconciliation, and use telemetry to explain how requests approached that state.

Business outcome and telemetry are separate evidence pathsA request creates an operation record and triggers asynchronous completion. Metrics, logs and traces observe parts of that path. Their collector can lose evidence independently of the business workflow.Request attemptOperation committedWorkflow completeSelected telemetry → collector

A trace identifier helps correlate observations. W3C Trace Context standardizes propagation fields between components; it does not guarantee instrumentation, collection or storage. Keep request correlation distinct from authentication and operation idempotency.

Useful service indicators name their numerator, denominator, time window and measurement boundary. For example, completion within a declared deadline is a different indicator from successful HTTP acceptance. Define how pending work, explicit rejection and missing observations enter the calculation.

Follow a checkout through OpenTelemetry

Sam needs evidence about a checkout that crossed the application, Postgres and a card-provider boundary. OpenTelemetry spans describe timed operations and their relationships, while metrics summarize repeated observations. Logs can retain selected events and details. None of these representations establishes business authorization automatically; a separate durable audit record answers who was permitted to perform the operation and what was accepted.

Trace context carries identifiers across a handoff. The receiving service still has to create and export its observation, and collection and retention can lose data. For an asynchronous job, preserve the causal relationship without claiming that all work happened inside one uninterrupted request. A missing span can mean missing instrumentation or loss rather than proof that a call never happened.

Consider a hypothetical day with twenty thousand eligible requests and thirty failures under a declared request-based objective. The failure fraction is 30 / 20,000 = 0.0015 = 0.15%, so the observed success fraction is 99.85%. A 99.9% request objective would allow 20,000 × 0.001 = 20 failures, making this sample ten failures beyond its allowance. This calculation uses requests as the denominator; it does not translate directly into minutes of downtime.

Sampling and aggregation shape investigation. A five-percent trace sample from twenty thousand runs would retain about one thousand if selection follows that rate, leaving about nineteen thousand without a retained trace. Keep the required audit evidence independently. For alerting, distinguish a low error count caused by healthy work from one caused by no traffic reaching the measured service. Define the user boundary, eligible events and missing-data behavior before choosing the dashboard.

Calculate the budget you actually defined

Hypothetical scenario. Choose a 30-day measurement window. Its duration is 30 × 24 × 60 × 60 = 2,592,000 seconds. A chosen time-based availability objective of 99.9% permits 2,592,000 × (1 − 0.999) = 2,592 seconds, or 43.2 minutes, of unavailable time under that indicator's definition.

A separate request-based example receives exactly 10,000 eligible requests per second throughout the window. Its count is 10,000 × 2,592,000 = 25,920,000,000 requests. With a chosen 99.9% successful-request objective, the allowed unsuccessful count is 25,920,000,000 × 0.001 = 25,920,000.

At a separately chosen 99.99% time-based objective, the same window permits 2,592,000 × 0.0001 = 259.2 seconds, or 4.32 minutes. These budgets describe different populations. With variable traffic, a brief busy-period outage can consume a large request-based budget while using little elapsed time. Partial failure can affect some operations throughout the window without making the whole service unavailable under a binary time-based definition.

For sampling, choose 1,000 independent traces, each retained independently with probability 0.1. The expected retained count is 1,000 × 0.1 = 100, not a promise that exactly 100 are stored. If a rare failure occurs once, this head-selection model retains its trace with probability 0.1, even though the overall traffic sample looks substantial.

For metric dimensions, choose 20 operation names, five result categories and three regions. Their full combination contains 20 × 5 × 3 = 300 label sets before further histogram or storage representation. Adding 100,000 customer identifiers would expand that theoretical combination to 30,000,000. Actual emitted combinations may be fewer, but an unbounded identity dimension changes the resource problem.

In the wild: Follow a checkout through OpenTelemetry

The primary reference establishes this concrete distinction: trace Context standardizes propagation, not complete collection or storage.

Selection and loss shape the story

OpenTelemetry's sampling guidance distinguishes early head decisions from tail decisions using later information. Tail selection can prioritize observed error traces, but cannot recover spans that never arrived. Buffering, late spans, capacity and policy behavior remain operational concerns.

Telemetry can also be systematically biased. A process that crashes before exporting may omit the very request being investigated. Sampling only completed requests can exclude stalled work. A duration histogram measured at one boundary should not be presented as another boundary's user latency.

Protect the application's resource budget from its measurement path. Backpressure or excessive logging can worsen an outage; dropping evidence changes what investigators can conclude. Monitor collection health and document the chosen loss and buffering behavior rather than claiming complete capture.

The alert stays silent when traffic disappears

Hypothetical scenario. An alert evaluates the fraction of failed responses. A routing error prevents callers from reaching the service, so the service records neither successes nor failures. The alert remains quiet because its data does not represent the failed user requests.

Add evidence at a boundary that can observe the missing journey, such as an independently operated external check or upstream request accounting. Decide how an absent denominator is represented; silently interpreting no data as perfect success creates an unjustified conclusion.

Incident review should preserve the uncertainty. Compare routing changes, arrival counts, operation state and collector health. An empty trace search is evidence that no matching trace was found in that store under that query, not proof that no request or effect occurred.

Do not promote proxies to proof

“Every error trace is retained.” A selection policy can target received errors without guaranteeing every failing path was instrumented and delivered.

“The error budget specifies a universal launch freeze.” The arithmetic derives a budget; an operating policy defines the response, exceptions and recovery criteria.

“The slowest span is the root cause.” The span can include waiting caused elsewhere, omit uninstrumented work or reflect a downstream symptom. Investigate the causal path rather than assigning blame from duration alone.

Measure for a decision

Use telemetry to support explicit decisions: detect user harm, identify a constrained resource, reconcile an uncertain operation or compare a change. State what evidence would change the current explanation. Collect enough context to investigate without copying sensitive request bodies into every log.

Keep metric dimensions bounded and put selected high-cardinality investigation context in an appropriately controlled evidence store. Apply access and retention rules to operation identifiers and trace attributes. Correlation can expose sensitive relationships even without the full payload.

The next lesson uses these measurements to control overload. Latency, queue age, errors and saturation need meaningful boundaries before they can guide admission, deadlines or recovery. A control loop driven by a misleading success counter can protect the wrong behavior.

Limits of this model

These request-based examples depend on a declared eligibility rule and complete enough outcome accounting. Sampled traces cannot prove the absence of an operation. Retention, privacy, collector failures and clock uncertainty limit telemetry, while authorization evidence needs its own durable record.

Check yourself: qualify the conclusion

No failed requests appear in the service counter, but upstream traffic fell abruptly. Is the journey healthy?

The service counter cannot establish that. Investigate arrival coverage and independent user-boundary evidence. Missing requests and missing telemetry must not become automatic successes.

A trace ends with timeout after a database call. Did the reservation fail?

The trace alone does not establish the effect. Reconcile the authoritative logical operation and its result. The response may have been lost after commit.

A 99.9% request objective and a 99.9% time objective use the same percentage. Are their budgets interchangeable?

No. One counts eligible requests and the other elapsed availability under a definition. Traffic variation and partial failure make their consequences different.

Northwind decision log

Use traces for causality and metrics for service outcomes.
Carry correlation through each remote handoff.
Keep audit evidence independently of trace sampling.

Go deeper: Follow a checkout through OpenTelemetry

Related blog: Traces and audit records answer different questions.