Hi Patrick, On Fri, May 24, 2019 at 09:00:25AM -0400, Patrick Hemmer wrote: > Is there a way to capture (and log) headers from http/2 response trailers? > The documentation doesn't mention trailers, and when I try to reference > headers which are present in the trailers (e.g. "res.fhdr(grpc-status)"), it > doesn't get captured. > > At the end of the day I'm trying to log the grpc-status and grpc-message > headers from gRPC responses.
For now you can't. In fact, in legacy mode, trailers are simply dropped, and in HTX they're currently encoded in H1 format. Some work has begun to encode them the same way as regular headers, hoping that in a near future they can have a more official existence. In this case we could imagine adding a new analyser which passes after the data forwarding ones to deal with those, and possibly capture them. Depending on the complexity this represents we may even possibly imagine backporting this to 2.0 (e.g. if it's just one analyser triggered in this case). Based on your experience with gRPC, do you think it would be better to have different sample fetch functions to look up trailers or to use the same as the header ones ? My reading of the gRPC spec told me that the header fields could appear either in headers or trailers sections, which tends to make me think a unified set would be desirable. But there may be very valid reasons for prefering to separate them. Cheers, Willy

