liveBook · Manning

Instrumentation cost

As explained in Cloud Observability in Action

An instrumentation cost is the labor, debugging effort, and resource consumption incurred by adding and maintaining telemetry instrumentation.

Instrumentation cost is the labor, debugging effort, and resource consumption required to add and maintain telemetry. It includes developer time, application CPU and memory overhead, agent runtime usage, network traffic, ingestion, storage, and query costs. In observability planning, these costs must be weighed against goals such as faster recovery and reduced on-call stress. section 1.5.1 section 8.3.2

A practical code-level measure is the business logic to instrumentation ratio (B2I): LOC after instrumentation divided by LOC before instrumentation. A ratio of 1.105 results from adding 400 instrumentation lines to 3,800 original lines. Treat B2I as a rough regression guide, not a quality score or an absolute limit. section 2.2

Costs vary by signal and by the systems that collect and retain it:

  • Logs are generally cheap and simple to add, but agents introduce runtime, ingestion-performance, reliability, security, and destination-retention considerations. section 2.3.3
  • Traces require more code effort: the illustrated example reaches a B2I ratio of 2.79, while propagation adds communication latency and bandwidth overhead. section 2.5.3
  • Sampling controls trace transport and storage costs: head-based sampling is simpler and deterministic, while tail-based sampling retains more state and can require more resources. section 2.5.3
  • Select sources backward from the task or role, because each source can require instrumentation, agents, storage, and other investments. section 3.1

Comparing signal effort

An example service grows from 24 lines to 32 after log instrumentation, producing a B2I ratio of 1.33. The same starting code reaches 99 lines with logs, metrics, and traces; after isolating the trace contribution, traces add 67 lines and produce a ratio of 2.79. The comparison makes the extra implementation effort visible before agent, network, storage, and query costs are included. section 2.3.3 section 2.5.3

B2I = LOC_AFTER_INSTRUMENTATION/LOC_BEFORE_INSTRUMENTATION

Use the B2I formula to compare code growth before and after adding a signal. section 2.2

How Cloud Observability in Action covers it

How deep it goes
Measures code growth with B2I and compares signal overheads, but defers detailed trace sampling treatment to later coverage.
Examples
Compares line counts and B2I ratios for logs, metrics, and traces in an example service.
What it assumes
Assumes basic observability and distributed-system terminology while introducing cost categories and B2I from first principles.
What you can do after
Evaluate instrumentation choices with B2I, resource-footprint, sampling, retention, and task-alignment considerations.
How it connects
Connects observability with telemetry signals, agents, network usage, storage, query costs, and sampling.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Cloud Observability in Action. The section links point to the parts of the book it draws on.