-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Allow prepending access log handler for HTTP stream filter #35595
Conversation
7b62912
to
0af0fba
Compare
Signed-off-by: spacewander <[email protected]>
0af0fba
to
bad77a0
Compare
The CI failed because of "tar: 91af38e56cd74a0fae3b2155c9ba4469_archive.tar: Cannot write: No space left on device It's not caused by the code. |
/retest |
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, but needs main merged
@zuercher |
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.
this is a little late but I doubt if this a best way to do this.
The new interface results in a new problem: we can not ensure the loggers' order base on the filters' order of http_filters
configuration.
I think maybe the better way is to make the access logger to be called at end directly.
And other loggers that added by filters will keep their order in filter chain.
This is a behavior change. But I think it's okay and could be guard by a runtime flag.
/wait-any
The core reason for me to add a new If a break change is acceptable by several Envoy maintainers, we can also solve this problem by reordering the access log added order. |
Back compatibility is great. But if it is a detail that no one care or we can prove this new design is better, than I think behavior change is acceptable. I think this is why our change logs have a behavior change list and minor behavior change list. Our access loggers do nothing except flushing log entries. So, I cannot image any one will depends on current logging order. A runtime guard is good enough, I think. cc @envoyproxy/senior-maintainers |
Thinking about this some more, I agree this doesn't seem like a great idea. I had just skimmed the discussion in #14767 without much thought. It seems like putting filter-added access loggers ahead of HCM access loggers (e.g. #14767) makes some sense, but this doesn't actually do that. It just allows filters to puts themselves at the head of the queue. You've changed the golang test to grab the filter's callback to mutate the It seems to me that golang HTTP filters should modify dynamic metadata during HTTP decoding/encoding rather than trying to mutate the StreamInfo at log time. I don't think we'd allow a C++-only http filter that did this. It may be the case that there should be a way to register a callback on a filter that occurs before |
We have no way to forbid const_cast in extension implemention. Although this is not good practice and some times may dangerous. |
There is a callback named So if the log handler is designed to be read-only, the solution may be to let the wasm/Golang filters utilize the |
If that callback's invocation meets the needs then yes, that seems like a better implementation that doesn't perform actions that are unexpected in an access logger. |
As discussed from https: //github.com/envoyproxy/pull/35595#issuecomment-2278413889, the `AccessLogHandler::log` is not designed for mutating the StreamInfo. It's recommended to use `OnStreamComplete` to do the final metadata management. Signed-off-by: spacewander <[email protected]>
As discussed from https: //github.com/envoyproxy/pull/35595#issuecomment-2278413889, the `AccessLogHandler::log` is not designed for mutating the StreamInfo. It's recommended to use `OnStreamComplete` to do the final metadata management. Signed-off-by: spacewander <[email protected]>
Surpassed by #35742 |
As discussed from #35595 (comment), the `AccessLogHandler::log` is not designed for mutating the StreamInfo. It's recommended to use `OnStreamComplete` to do the final metadata management. Signed-off-by: spacewander <[email protected]>
…proxy#35742) As discussed from envoyproxy#35595 (comment), the `AccessLogHandler::log` is not designed for mutating the StreamInfo. It's recommended to use `OnStreamComplete` to do the final metadata management. Signed-off-by: spacewander <[email protected]>
Commit Message: Allow prepending access log handler for HTTP stream filter
Additional Description: Also change the Golang filter to use this new feature
Risk Level: Low
Testing: Integration
Docs Changes:
Release Notes: Added
Platform Specific Features:
[Optional Runtime guard:]
Fixes #14767
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]
CC @doujiang24