You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I was looking through the poem source code and noticed an issue in the tracing middleware.
The tracing docs say:
Note: The fields associated with a span are part of its Metadata. The Metadata describing a particular span is constructed statically when the span is created and cannot be extended later to add new fields. Therefore, you cannot record a value for a field that was not specified when the span was created:
Just had a chance to take a look and I don't think the PathPattern extraction for the tracing middleware works at all.
Using with(Tracing) creates a TracingEndpoint<Route> where TracingEndpoint::call is called first and then it passes the request onto Route::call. PathPattern is added to the request by Route::call so it doesn't exist when TracingEndpoint::call is called.
Does anyone have ideas of how we could fix this?
The only solution I can think of is to change the signature of Endpoint::call from fn call(&self, mut req: Request) to fn call(&self, &mut req: Request) so that we can read from the request after calling Route::call although I dread to think what other issues this change would cause.
Hello,
I was looking through the poem source code and noticed an issue in the tracing middleware.
The tracing docs say:
Source
It appears that poem violates that rule in the tracing middleware.
I've not actually validated this is an issue; just something I ran into on another project.
I'm fairly new to Rust and the Tracing crate so I might be mistaken. I'm happy to raise a pull request for the fix.
The text was updated successfully, but these errors were encountered: