macro_rules! enter_request {
($req:expr, $name:literal) => { ... };
($req:expr, $name:literal, $container_id:expr) => { ... };
(@enter $req:expr, $span:ident) => { ... };
}Expand description
Enter the root span of a request for the rest of the handler, with the parent context the client sent.
The span of a request for a container is one of the error level, so that the log drivers show the container ID at every log level, also for what the tasks which the request starts log later, like the watcher and the read loops of a container. The lines of a warning or an error would not tell which container they are about otherwise. The request ID only helps to tell the debug lines of concurrent requests apart, so it gets created and formatted only for them. The level comes from the hint of the subscriber: asking it whether a debug event is enabled would leave the state of the per-layer filter of a log driver behind, which the next line would get dropped for, if no event follows in the request.