Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of additional %UPSTREAM% variables to custom headers #13897

Open
vinzo99 opened this issue Nov 4, 2020 · 5 comments
Open

Add support of additional %UPSTREAM% variables to custom headers #13897

vinzo99 opened this issue Nov 4, 2020 · 5 comments
Labels
area/http design proposal Needs design doc/proposal before implementation help wanted Needs help!

Comments

@vinzo99
Copy link

vinzo99 commented Nov 4, 2020

One of our customers is using the Envoy tap filter to retrieve transport information and add them to their request/response headers, as documented here : https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_conn_man/headers.html#custom-request-response-headers

At this point, very few %UPSTREAM% variable names are supported :
%UPSTREAM_METADATA([“namespace”, “key”, …])%
%UPSTREAM_REMOTE_ADDRESS%

They wish additional %UPSTREAM% variables were supported, such as %UPSTREAM_LOCAL_ADDRESS%.

Thanks !

@vinzo99 vinzo99 added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Nov 4, 2020
@lambdai
Copy link
Contributor

lambdai commented Nov 5, 2020

See my previously raised issue #12236 , the PR is proposed and the discussion.

The major blocker is that retry would change the upstream info and there is no well defined api.

So we need either evolve the route action or see how to adopt this requirement in Http upstream filter upstream http filter

@antoniovicente
Copy link
Contributor

@vinzo99 Do you expect to need the ability to populate %UPSTREAM_LOCAL_ADDRESS% on the request headers sent to the upstream or only on the reply headers proxied back to the downstream? The later is doable, it just needs to be implemented. Are there other pieces of information about the upstream that you'ld like to communicate to the downstream via added reply headers?

@lambdai Yeah, we would need some way to delay computation of said headers and recompute them on retry. We would also need to decide if retries should append to the modified headers or replace the relevant header lines.

@antoniovicente antoniovicente added help wanted Needs help! question Questions that are neither investigations, bugs, nor enhancements area/http and removed triage Issue requires triage enhancement Feature requests. Not bugs or questions. help wanted Needs help! labels Nov 9, 2020
@lambdai
Copy link
Contributor

lambdai commented Nov 10, 2020

There are several workaround or plans

  1. As @antoniovicente mentioned, if the upstream header need to be populated by HCM router filter, the api need to be consistent on execution per-retry mutation, sanitize on retry(append or override)...
  2. Done by cluster upstream extension: See example here extension: add test case #13915. This header rewrite is strictly after router rewrite so the new header is invisible to router. Need to use with causion.
  3. Http upstream filter is the chance to reorganize the rewrite phases Upstream HTTP filters #10455

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Dec 10, 2020
@vinzo99
Copy link
Author

vinzo99 commented Dec 10, 2020

Reviving thread

@mattklein123 mattklein123 added design proposal Needs design doc/proposal before implementation help wanted Needs help! and removed question Questions that are neither investigations, bugs, nor enhancements stale stalebot believes this issue/PR has not been touched recently labels Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/http design proposal Needs design doc/proposal before implementation help wanted Needs help!
Projects
None yet
Development

No branches or pull requests

4 participants