← AI-Driven Development

Observability

Observability in this methodology is not production monitoring. It is development-time verification. Traces, logs, and metrics are the evidence used to evaluate whether the system behaves correctly, not just whether it returns the right response.

Three Signals

Traces

Distributed traces show the full execution path: every span, every DB query, every message handler, every external call. Inspect them after every callable surface invocation during a journey walk.

SignalFinding
Same entity loaded 2+ times in one traceRedundant query. Handler re-fetches what is already in scope.
status: Error on child span, root span succeededBroken async consumer. Request returned 200, downstream handler failed.
10+ DB spans for a simple operationOver-querying. Likely N+1 or missing eager load.
External HTTP call > 2 secondsLatency risk. Slow external dependency.
Event published with zero consumer spansPublished event with no handler. Subscription is wrong or missing.

Logs

Structured logs with trace context show what happened at each point in the execution path. Inspect when a trace shows an error span or unexpected behavior.

SignalFinding
Exception logged on a non-error spanSwallowed exception. Caught and logged but not propagated.
Validation failure logged but not returnedSilent validation. Client gets 200, input was partially invalid.
Log entry without trace contextMissing correlation. Cannot link to the request that caused it.

Metrics

Request counts, error rates, latency distributions, queue depths. Compare aggregate metrics before and after a change to detect regressions.

Healthy Trace Patterns

What a correct trace looks like depends on the operation type. These are baseline budgets, not hard rules. Adjust per system.

Simple read (list, get by ID)

Simple mutation (create, update)

Batch operation

Cross-module operation (external service)

Trace Analysis

Manual trace inspection does not scale. The methodology defines a trace analysis tool (MCP server) that accepts a trace ID, extracts structured metrics (span count, DB queries, errored spans, duplicate loads, external call durations), compares against budgets, and returns binary violations with evidence.

See the trace analyzer spec for details.


Full observability methodology →