gateway icon indicating copy to clipboard operation
gateway copied to clipboard

feat(translator): xds route and vhost metadata

Open guydc opened this issue 1 year ago • 14 comments

What this PR does / why we need it:

  • Design doc for metadata propagation
  • Implement propagation of HTTPRoute/GRPCRoute metadata to envoy route resources
  • Implement propagation of Gateway and Listener to Virtual Host metadata
  • e2e test based on access logs - verifying that metadata is printed to the log. If injection of METADATA-based header is supported (https://github.com/envoyproxy/envoy/issues/34671), this test can be simplified to make an assertion on generated headers.

Which issue(s) this PR fixes: Relates to #3318

guydc avatar Jun 12 '24 23:06 guydc

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 68.97%. Comparing base (ec9945a) to head (e54b00f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3602      +/-   ##
==========================================
+ Coverage   68.81%   68.97%   +0.16%     
==========================================
  Files         175      176       +1     
  Lines       21524    21610      +86     
==========================================
+ Hits        14811    14906      +95     
+ Misses       5636     5628       -8     
+ Partials     1077     1076       -1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 12 '24 23:06 codecov[bot]

/retest

guydc avatar Jun 17 '24 12:06 guydc

/retest

guydc avatar Jun 20 '24 21:06 guydc

/retest

guydc avatar Jun 21 '24 10:06 guydc

@zirain @guydc thoughts on adding this metadata by default to our default access log definition ?

arkodg avatar Jun 25 '24 19:06 arkodg

/retest

guydc avatar Jun 25 '24 21:06 guydc

/retest

guydc avatar Jun 25 '24 22:06 guydc

/retest

guydc avatar Jun 26 '24 11:06 guydc

@zirain @guydc thoughts on adding this metadata by default to our default access log definition ?

I don't think we should add them by default, users who want can add the command.

zirain avatar Jun 26 '24 11:06 zirain

Also fine with allowing users to add this if needed.

guydc avatar Jun 26 '24 12:06 guydc

/retest

guydc avatar Jun 27 '24 16:06 guydc

/retest

zirain avatar Jun 28 '24 00:06 zirain

@zirain @guydc thoughts on adding this metadata by default to our default access log definition ?

IMO, adding them to the default access log format would be a pleasant surprise to EG users. I would recommend adding it unless we have strong reasons against it.

zhaohuabing avatar Jun 28 '24 01:06 zhaohuabing

Sorry for force-push, I messed up the recent commit.

We will go with the list approach, since it's most future proof, considering situations where multiple resources of the same kind (e.g. policy and overriding policy) can contribute metadata.

Since there's currently no convenient way to reference a specific member of a list in envoy formatter at the moment, I prefer to leave metadata out of the default access log format, and not log all metadata by default.

guydc avatar Jul 01 '24 22:07 guydc