What is the difference between gRPC metadata sent as headers versus trailers, and what is binary metadata?
Last updated
Headers (leading metadata) are sent before the message body, so they carry values known up front like auth tokens and request IDs.
Trailers are sent after the body, so they carry values computed during processing such as
grpc-status,grpc-messageand metrics. This is essential for streaming.Binary metadata uses keys ending in
-binto hold arbitrary bytes (base64-encoded on the wire automatically). Other values must be ASCII strings.
- https://grpc.io/docs/guides/metadata/
- https://grpc.github.io/grpc/core/md_doc__p_r_o_t_o_c_o_l-_h_t_t_p2.html
- https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md
- https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md?plain=1
- https://oneuptime.com/blog/post/2026-01-24-grpc-metadata/view
- https://kreya.app/blog/grpc-deep-dive/