Skip to content

Log HTTP Request and Response Trailers #31840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jkotalik opened this issue Apr 15, 2021 · 9 comments
Open

Log HTTP Request and Response Trailers #31840

jkotalik opened this issue Apr 15, 2021 · 9 comments
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Milestone

Comments

@jkotalik
Copy link
Contributor

As a follow up to #31816, we should log Http Request and Response trailers if available.

I see a few potential issues:

  • Making sure the trailers are committed before the body is written
  • Having a delimiter between headers and trailers?
@JamesNK
Copy link
Member

JamesNK commented Apr 15, 2021

@Tratcher @halter73 @davidfowl

The trick here will be logging them when they are all available and before they disappear. This will be especially true with response trailers. With them you'll need to wait until the response body has finished writing (someone could add a trailer at any time while the response is writing) but before the response ends.

@Tratcher
Copy link
Member

Logging the response trailers as the middleware exits should be adequate, it will capture trailers added by anything after it. That does leave a window between this middleware and the start of the pipeline where someone else could add trailers, but that seems like a tradeoff people would be able to understand. In theory you could have the same problem with response headers when there's no body.

Request trailers could be logged when the end of the request body is read (we'll be wrapping the body so we'll know), or when the middleware exits.

@ghost
Copy link

ghost commented Apr 20, 2021

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. Because it's not immediately obvious that this is a bug in our framework, we would like to keep this around to collect more feedback, which can later help us determine the impact of it. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@ghost
Copy link

ghost commented Aug 3, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@Tratcher Tratcher modified the milestones: Backlog, .NET 7 Planning Oct 28, 2021
@adityamandaleeka
Copy link
Member

@wtgodbe @Tratcher Have we seen any demand for this? I'm inclined to move it back to backlog.

@Tratcher
Copy link
Member

gRPC would be the main scenario. @JamesNK?

@JamesNK
Copy link
Member

JamesNK commented Aug 23, 2022

gRPC uses response trailers. Important information - grpc-status (i.e. did the RPC succeed) - is sent via trailers.

@JamesNK
Copy link
Member

JamesNK commented Aug 23, 2022

(I think it should be left here for .NET 8) I think it should be moved to .NET 8 planning.

@adityamandaleeka
Copy link
Member

Done.

@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
@amcasey amcasey modified the milestones: .NET 8 Planning, Backlog Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

No branches or pull requests

6 participants