-
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
Unable to access filter state from with Golang filter #34183
Comments
Hello @asialea
could you please show some related key C++ code? i.e. how they get the values. And could you please try the Lua http filter to get the dynamicmetadata? I think there might be some difference to get values which is setted by a listener filter |
Sure so here is a code snippet on how these values are set inside our custom listener filter
Here is the setFilterState method used above
Here is the code on how the state is retrieved in a custom http filter later on in the chain. These same values from filter state is also able to be accessed by the access logger using FormatStrings
Here is the getFilterStateStringData method used above
|
https://github.com/envoyproxy/envoy/blob/main/contrib%2Fgolang%2Ffilters%2Fhttp%2Fsource%2Fgolang_filter.cc#L1242-L1244 |
okay, I see. we should use |
Title: Unable to access filter state from with Golang filter
Description:
Hi team, facing a strange issue attempting to access filter state from within the golang http filter. We have a listener filter which sets keys in both both dynamic metadata and filter state which is successfully accessed by other c++ filters in the chain. When attempting to access these same keys from within the http golang filter, dynamic metadata is empty and the keys do not exist in the filter state.
Any pointers would be appreciated.
[optional Relevant Links:]
envoy/contrib/golang/filters/http/source/go/pkg/http/filter.go
Line 306 in 416cd42
The text was updated successfully, but these errors were encountered: