tracecheck

command
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Command tracecheck is the trace-coverage gate: it fails the build when a code path that should be visible in a trace is not.

Why this exists: the gazetteer feature shipped six public service methods with no spans at all. Nothing was broken, every test passed, and the gap only surfaced when a trace of a slow request showed 828 of 829 ms as empty space. Instrumentation has no failing test to protect it, so it needs a gate instead.

Two rules, both derived from the code rather than an allowlist, so a newly added method is covered the moment it is written:

  1. Every exported method on an application service that takes a context.Context must open a span — directly, or through a helper in the same package that opens one (e.g. gazetteer's beginSection).

  2. Every method of a Traced* decorator in the adapters must open a span, and each decorator must carry a compile-time assertion that it satisfies its port interface. The assertion is what turns "the port grew a method and the decorator silently stopped covering it" into a compile error.

Usage: go run ./tools/tracecheck [rootdir]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL