Skip to content

thrift_proxy: Add thrift header to metadata filter#18637

Merged
mattklein123 merged 18 commits intoenvoyproxy:mainfrom
fishcakez:thrift-h2m-proto
Nov 9, 2021
Merged

thrift_proxy: Add thrift header to metadata filter#18637
mattklein123 merged 18 commits intoenvoyproxy:mainfrom
fishcakez:thrift-h2m-proto

Conversation

@fishcakez
Copy link
Contributor

@fishcakez fishcakez commented Oct 15, 2021

Commit Message: thrift_proxy: Add thrift header to metadata filter
Additional Description: Transforming headers to metadata and then using that metadata for subset load balancing, logging or other custom functionality is fundamental part of envoy proxy capabilities. Therefore add header to metadata proto configuration that is exactly like the http equivalent.
Risk Level: low
Testing: N/A
Docs Changes: N/A
Release Notes: new feature
Platform Specific Features: N/A
Fixes #18578: Filter to support this feature.
API Considerations(https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md): Given this is a clone of the http header to metadata config (without cookie support and with the future one of promotion) I believe it should pass the checklist.

Signed-off-by: James Fish <jfish@pinterest.com>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/envoy/.
envoyproxy/api-shepherds assignee is @mattklein123
CC @envoyproxy/api-watchers: FYI only for changes made to api/envoy/.

🐱

Caused by: #18637 was opened by fishcakez.

see: more, trace.

Signed-off-by: James Fish <jfish@pinterest.com>
Signed-off-by: James Fish <jfish@pinterest.com>
Signed-off-by: James Fish <jfish@pinterest.com>
Signed-off-by: James Fish <jfish@pinterest.com>
Signed-off-by: James Fish <jfish@pinterest.com>
Signed-off-by: James Fish <jfish@pinterest.com>
Signed-off-by: James Fish <jfish@pinterest.com>
Signed-off-by: James Fish <jfish@pinterest.com>
@mattklein123
Copy link
Member

cc @rgs1

/wait-any

rgs1
rgs1 previously approved these changes Oct 15, 2021
Copy link
Member

@rgs1 rgs1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- thanks!

cc: @envoyproxy/api-shepherds

@mattklein123
Copy link
Member

Do you want to just add the filter at the same time? This seems fine to me.

/wait-any

@fishcakez
Copy link
Contributor Author

Do you want to just add the filter at the same time?

Will do it later in the week as need a couple of changes from our internal filter.

Signed-off-by: James Fish <jfish@pinterest.com>
Signed-off-by: James Fish <jfish@pinterest.com>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @mattklein123
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #18637 was synchronize by fishcakez.

see: more, trace.

Signed-off-by: James Fish <jfish@pinterest.com>
@fishcakez fishcakez changed the title thrift_proxy: Add thrift header to metadata proto config thrift_proxy: Add thrift header to metadata Nov 3, 2021
@fishcakez fishcakez changed the title thrift_proxy: Add thrift header to metadata thrift_proxy: Add thrift header to metadata filter Nov 3, 2021
Signed-off-by: James Fish <jfish@pinterest.com>
Signed-off-by: James Fish <jfish@pinterest.com>
Signed-off-by: James Fish <jfish@pinterest.com>
Signed-off-by: James Fish <jfish@pinterest.com>
Signed-off-by: James Fish <jfish@pinterest.com>
@fishcakez
Copy link
Contributor Author

@fishcakez
Copy link
Contributor Author

ASAN failure is due to publishing test results timeout:

##[error]The HTTP request timed out after 00:00:30.

@mattklein123
Copy link
Member

@rgs1 to do first pass review, thank you.

Copy link
Member

@rgs1 rgs1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 comments - thanks!

ConfigSharedPtr filter_config(std::make_shared<Config>(proto_config));
return
[filter_config](ThriftProxy::ThriftFilters::FilterChainFactoryCallbacks& callbacks) -> void {
callbacks.addDecoderFilter(std::make_shared<HeaderToMetadataFilter>(filter_config));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we don't need a new shared ptr on every call, pass a ref to filter config?

xiaoma2015
xiaoma2015 previously approved these changes Nov 5, 2021
Signed-off-by: James Fish <jfish@pinterest.com>
Copy link
Member

@rgs1 rgs1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks!

Over to @zuercher or @mattklein123 for merging.

@repokitteh-read-only repokitteh-read-only bot removed the api label Nov 9, 2021
@mattklein123 mattklein123 merged commit 6acc5d2 into envoyproxy:main Nov 9, 2021
@fishcakez fishcakez deleted the thrift-h2m-proto branch November 9, 2021 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support header-to-metadata filter for thrift

4 participants