Skip to content

Feature request: ability to use x-request-id in response_headers_to_add #8683

@ascheglov

Description

@ascheglov

Currently there is no way to use request headers in response_headers_to_add (it doesn't support %REQ(header-name)%).

However it would be nice to have an access to certain headers, namely x-request-id.

Normally a backend would echo the x-request-id header, so that it would be proxied to a client.
When there is a request timeout, envoy sends the "504 upstream request timeout" reply, and the client doesn't get the x-request-id.

Although it might be useful to echo other envoy-generated request headers (e.g. uber-trace-id for traces), for now it would be sufficient to add the %REQUEST_ID% in StreamInfoHeaderFormatter, requestId in StreamInfo, and set it in the http connection manager together with setDownstreamRemoteAddress, after the ConnectionManagerUtility::mutateRequestHeaders call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests. Not bugs or questions.help wantedNeeds help!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions