0PricingLogin
gRPC & High Performance APIs · Lesson

Custom Metadata Transmission

Discover how to send and receive custom key-value pairs as metadata with gRPC requests and responses.

What is gRPC Metadata?

In gRPC, metadata refers to key-value pairs that are attached to an RPC call, similar to HTTP headers.

Unlike the main message payload, metadata carries information about the call itself, rather than the application data being transmitted.

  • It's for auxiliary data.
  • It travels with requests and responses.
  • It's separate from your protobuf messages.

Why Use Metadata?

Metadata is incredibly useful for carrying information that doesn't belong in your service's primary request or response messages.

Common use cases include:

  • Authentication Tokens: Sending JWTs or API keys.
  • Tracing IDs: Propagating unique request IDs for distributed tracing.
  • Custom Headers: Any other contextual information needed by your services.

All lessons in this course

  1. Status Codes and Error Handling
  2. Custom Metadata Transmission
  3. Context and Deadlines
  4. Rich Error Models with google.rpc.Status
← Back to gRPC & High Performance APIs