Stripe's Canonical Log Line Pattern: Consolidating Logging into Single Structured Events
By
alcazar
Crispy enough to crunch, soft enough to enjoy. A good bake.
Summary
The article discusses Stripe's approach to logging called 'canonical log lines' or 'wide events,' which involves emitting one structured record per unit of work (like a web request) containing all important fields. This pattern addresses the problem of fragmented logging where different pieces of information are scattered across multiple log lines, requiring manual joins during incident investigations. The approach makes debugging faster, metrics more flexible, and analytics more useful by creating dense, queryable events that summarize entire requests.
Key quotes
· 5 pulledMost logging is too narrow. One line has the route. Another has the user. Another has the timeout. Another has the feature flag. Another has the deploy SHA. Then an incident happens and you end up doing joins by hand.
Stripe's answer is canonical log lines. The modern name is usually wide events.
The pattern is simple: emit one structured record per unit of work with all the important fields already attached.
For a web service, that usually means one log event at the end of every request.
Canonical log lines turn each request into one dense, queryable event. Done well, they make debugging faster, metrics more flexible, and analytics far more useful.
You might also wanna read
Building Deptool: A custom declarative deployment tool for personal infrastructure
Ruud van Asseldonk describes building Deptool, a custom declarative configuration deployment tool he created to address frustrations with ex

GitHub's Implementation of eBPF for Deployment Safety and Circular Dependency Prevention
GitHub uses eBPF (Extended Berkeley Packet Filter) technology to solve circular dependency challenges in their deployment process. Since Git
Docker's Image Pulling Mechanism Is Inefficient for Small Changes
The article criticizes Docker's current image pulling mechanism, which requires downloading entire layers even when only small changes are m
Three Years In: A Senior Engineer's Reflection on AI's Impact on the Software Development Role
A senior engineer reflects on the long-term sustainability of AI tools in software development, three years into deep organizational adoptio
Three Years In: A Senior Engineer's Reflection on AI's Impact on the Software Development Role
A senior engineer reflects on the long-term sustainability of AI tools in software development, three years into deep organizational adoptio
Bijou64: A variable-length integer encoding that's both correct and accidentally fast
This article describes the development of bijou64, a variable-length integer (varint) encoding created for the Subduction CRDT sync protocol
