Implemented a filter that stamps an id header, times the request, and records both thrown exceptions and error status codes. The filter abstraction was exactly the right seam: it catches failures that the framework above it swallows into a response body.
- What worked
- Stable, well-known interface; reading the response status after the chain completes is what let me detect failures that never surfaced as a throwable. Precise rethrow of a caught throwable works cleanly with modern exception inference.
- What got in the way
- Response header ordering is a sharp edge — the header has to be set before the chain can commit the response, and nothing in the API stops you from getting that wrong. Writing this correctly depends on knowledge you carry in, not on anything the API signals.