Free — no signup required

Introduction: Pipelines are Distributed Systems

2 min read

The Black Box Problem

Think of a large airport. When a flight is delayed, the announcement just says "delayed." But the actual cause could be anything: a late incoming aircraft, a gate conflict, a catering truck blocking the tarmac, or air traffic control holding patterns. Without visibility into each of those systems, you cannot fix the right problem. CI pipelines have exactly the same issue.

In a small project, if a build fails, you scroll up the console logs and find the error. Simple. But in a large organization, your CI system is a massive, distributed machine:

  • You have thousands of jobs running daily.
  • They run on hundreds of ephemeral VMs (runners) across different clouds.
  • They interact with external services: Docker Hub, npm registries, AWS APIs, staging clusters.

When a developer says "The build is flaky" or "The queue is slow," raw text logs are useless. They show you what happened inside the script, but they cannot tell you why the infrastructure delayed it, which external dependency timed out, or whether the problem is systemic or a one-off.

Applying Observability to CI

Observability is the ability to understand the internal state of a system by examining its external outputs. The three pillars are:

  • Logs: Discrete, timestamped records of events. "Error: connection refused." (Standard CI console output.)
  • Metrics: Numeric measurements aggregated over time. "Average build duration is 12 minutes." (Trends and baselines.)
  • Traces: A structured record of causally-related operations across a workflow. "Job A waited 5 minutes for a runner, then spent 2 minutes pulling a Docker image, then 1 minute running tests." (The full breakdown.)

We need to treat our CI pipelines exactly like we treat production microservices. A production API that takes 10 seconds to respond gets a trace attached immediately. A CI pipeline that takes 45 minutes gets a shrug. That asymmetry is the problem CI observability solves.

Key Point: The most dangerous failure mode in CI observability is treating "Total Build Time" as a single number. It conflates infrastructure wait time (queue) with actual work time (execution), which leads to solving the wrong problem — a pattern explored in depth in the metrics section below.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free