-
Notifications
You must be signed in to change notification settings - Fork 5.1k
h2m: add optional stats to header-to-metadata filter #40464
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
Conversation
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Signed-off-by: Rohit Agrawal <[email protected]>
|
may need to wait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. And I have added some comments first.
/wait
| if (config->stats().has_value()) { | ||
| config->stats().value().base64_decode_failed_.inc(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will inclined to createa method in the Config to accept the two enums, one enum for event, one enum for traffic direction.
Then handle all this logic in same method to avoid this if (config->stats().has_value()) everywhere. If we need to add new stats in the future, it would much simpler also.
|
/lgtm api |
Signed-off-by: Rohit Agrawal <[email protected]>
4e356ae to
663bd8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for update and LGTM overall. Only one last comment.
source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Rohit Agrawal <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
Description
This PR adds optional stats collection to Header-To-Metadata filter when enabled. It's quite helpful to understand when the header was missing, how many rules get processed, failures etc.
Commit Message: h2m: add optional stats to header-to-metadata filter
Additional Description: Adds optional stats collection to Header-To-Metadata filter when enabled.
Risk Level: Low
Testing: Added Tests
Docs Changes: Added
Release Notes: Added