natchez-http4s
natchez-http4s copied to clipboard
Move span creation to middleware
Proposal to change the behavior of NatchezMiddleware.server.
Currently, it puts the context into existing span. The span per request is created in the EntryPointOps, which is only used for Kleisli based implementation. It means that server middleware is not working correctly with IOLocal based tracing.
The proposal is to move the span creation (+ continuation) into middleware itself, and inject RootsSpan for Kleisli based routes.
If it's accepted, I can drop in few tests that verify that both IOLocal and Kleisli Trace implementations yield the same results.
:+1: for this, we've been having to write little wrapper middlewares to do the parent span options