Skip to main content

default_metadata_annotator

Function default_metadata_annotator 

Source
pub fn default_metadata_annotator(_req: &GatewayRequest) -> MetadataMap
Expand description

A metadata annotator that injects request context information.

This annotator:

  1. Generates and injects a unique request ID (x-request-id).
    • It assumes incoming x-request-id headers have been stripped by the HeaderLayer to ensure the ID is trusted and generated by the gateway.
  2. Injects the gateway IP as x-gateway-ip (placeholder).