A logbook and a stopwatch
There are two questions I ask when a request has gone to sit quietly in a corner. What was it doing? How long did it spend there?
I built two small Pooka libraries for those questions.
Write it down
Loggit sends events to Erlang's Logger. A message can carry fields for the request ID and route. The short console formatter leaves the line easy to read. A collector can still receive the structured event, and the detailed formatter can print fields, timestamps, and stack frames.
loggit.log(Level.Info, "request served", [
#("request_id", "req-42"),
#("route", "/books")
])
Mind the time
Tattle gives the caller a typed event bus to pass around. A span emits a start and then a stop or exception event. Its duration comes from the monotonic clock, and the caller still gets the callback's original result or exception.
tattle.span(bus, ["http", "request"], "/books", fn() { 200 })
Here the metadata is a string. Another bus might carry a record with a route, request ID, and tenant. Handlers run in the emitting process, so I keep mine quick and pass any slow work elsewhere.
I can use the two together. A span gives me the elapsed time. A log line gives me something to search for when I come back tomorrow.