Skip to content
matthewcm.dev

    ↑ ↓ move · ↵ open · tab scopeopen graph →

    Observability

    Being able to ask new questions of a running system from its outputs — logs, metrics and traces, tied to the SLOs that turn them into decisions.

    Growingtended planted 2 min read
    On this page

    Monitoring tells you whether the things you predicted would break have broken. Observability is the ability to ask questions you didn’t predict — “why are checkout requests from one region slow only for logged-in users?” — using only what the system emits. In a distributed system, where the Fallacies of Distributed Computing guarantee surprises, that difference matters.

    The three signals

    SignalWhat it isGood for
    LogsTimestamped events, ideally structured (JSON, not prose)The detail of what happened in one place
    MetricsNumbers aggregated over time: rates, counts, percentilesTrends, dashboards, cheap alerting
    TracesOne request’s path across services, as a tree of timed spansWhere the time or the error went in a multi-service call

    They’re far more useful joined up: a trace ID in every log line lets you jump from a spike on a dashboard to the exact requests behind it.

    The pipeline

    1. Instrument — OpenTelemetry has become the vendor-neutral standard for emitting all three signals.
    2. Collect and ship — agents and collectors (Fluentd, the OTel Collector) buffer and forward telemetry.
    3. Store and query — a metrics store, a log index, a trace backend.
    4. Alert on what users feel — not on CPU at 80%, but on the indicators behind your SLOs.

    The frontend counts too

    Observability doesn’t stop at the API. For UIs I want error tracking with source maps (Sentry-style), real-user performance metrics (Core Web Vitals), and for real-time interfaces, client-side measures like dropped frames and message lag. A trading screen can have perfect backend latency and still feel broken because the render loop can’t keep up — see Zustand Transient Updates.

    Pipelines, caches and long-running jobs

    Some components need their own vocabulary of signals:

    • Stream pipelines: records processed, bytes processed, error counts, and lag.
    • Caches: hit rate, miss rate, eviction rate, cache-operation latency and cache size, with alerts on all of them. TTL is a trade-off between freshness and hit rate. Long TTLs suit long-lived static content; recent user activity can’t be cached for long. Event-driven invalidation cuts staleness without shortening every TTL.
    • Long-running jobs: report partial progress and support restarting from checkpoints, so “is it stuck?” has an answer — see Resumable Batch Migrations.

    Trade-offs

    • Cost and noise. Logging everything is expensive and makes the signal harder to find. Sample traces; keep high-cardinality detail in traces and logs, not metrics.
    • Alert fatigue. Alerts that don’t require a human action train people to ignore alerts. Page on symptoms, not causes.
    • Privacy. Telemetry is data. Scrub tokens and personal data at the source.

    In practice

    The habit I’ve built is to treat observability as part of the definition of done: a feature isn’t finished until I can tell, from the outside, whether it’s working for users. The same idea applies to delivery itself — lead time and change failure rate are the telemetry of your process. And it applies to agents: if you can’t see what an AI agent perceived and why it acted, you can’t trust it.

    • #observability
    • #monitoring
    • #logs
    • #metrics
    • #tracing
    • #opentelemetry

    ↪ Links to (5)