Repository navigation
stream info: add listener info - #31365
Conversation
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
| constexpr absl::string_view RouteMetadata = "route_metadata"; | ||
| constexpr absl::string_view UpstreamHostMetadata = "upstream_host_metadata"; | ||
| constexpr absl::string_view FilterChainName = "filter_chain_name"; | ||
| constexpr absl::string_view ListenerMetadata = "listener_metadata"; |
There was a problem hiding this comment.
In what consideration not to use listener.metadata and listener.direction?
There was a problem hiding this comment.
You mean Wasm attributes? We should recommend the standard xds attributes once we finish replacing them, and then deprecate those one-off cases.
wbpcode
left a comment
There was a problem hiding this comment.
This enhancement look good to me. Two comments are added first to start review.
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
|
/retest |
| std::string ja3_hash_; | ||
| absl::optional<std::chrono::milliseconds> round_trip_time_; | ||
| FilterChainInfoConstSharedPtr filter_chain_info_; | ||
| OptRef<const ListenerInfo> listener_info_; |
There was a problem hiding this comment.
hmmm, the premise of my previous comments is that connection info provider will own a copy of listener info shared pointer.
So, I think the listenerInfo() of ListenerConfig needn't to change it's signature. But seems if we don't change the signature, there is no way to store a listener info shared pointer to the connection info provider.
Seems I was wrong, my bad.
There was a problem hiding this comment.
Maybe revert to your previous implementation would be better (use a shared pointer here).
Sorry again. 😞
There was a problem hiding this comment.
No problem, reverted. It was worth exploring the other option.
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
wbpcode
left a comment
There was a problem hiding this comment.
LGTM overall. It is almost done. Only two minor comments about the docs and an optional ASSERT.
| route_name, string, Route name | ||
| route_metadata, :ref:`Metadata<envoy_v3_api_msg_config.core.v3.metadata>`, Route metadata | ||
| upstream_host_metadata, :ref:`Metadata<envoy_v3_api_msg_config.core.v3.metadata>`, Upstream host metadata | ||
| node, :ref:`Node<envoy_v3_api_msg_config.core.v3.node>`, Local node description. DEPRECATED: please use `xds` attributes. |
There was a problem hiding this comment.
Seems node is not supported in the xds attributes from above docs?
There was a problem hiding this comment.
Good catch, the PR just went in, and fixed the missing doc.
| if (listener_info_ == nullptr) { | ||
| listener_info_ = std::make_shared<ListenerInfoImpl>(); | ||
| } |
There was a problem hiding this comment.
nit: ASSERT(listener_info_ == nullptr); to avoid unexpected regression.
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Commit Message: Expose listener info in stream info. Additional Description: Add relevant accessors in the access log and CEL attributes. Risk Level: low Testing: added Docs Changes: yes Release Notes: yes Fixes: envoyproxy#24303
Commit Message: wasm: fix multiple bug of vm key and plugin key calculation Additional Description: This PR fixed tow bugs of wasm vm cache key and wasm plugin cache key: - now, the whole PluginConfig will be used to calculate the cache key. Before this change, the plugins with different `allow_on_headers_stop_iteration` may hit same cached plugin handle and make unexpected behavior. - now, the `capability_restriction_config` and `runtime` will be used to calculate the vm cache key. Before this change, the plugin VMs with different `capability_restriction_config` and `runtime` may hit same cache and result in unexpected behavior. --- Now, we also removed the traffic direction from the plugin cache key. It's safe because it's unnecessary now. Long time ago, before the #31365, we cannot extract the listener info from the connection info, so the WASM will get the traffic direction and listener metadata from the FactoryContext and store the reference at the cached plugin. Then when `get_property` ABI is used, the plugin could serve the related attributes. And to avoid the wasm plugins that be configured in different listeners (with different direction/metadata) hit same plugin cache, we added the listener metadata and traffic direction in to plugin cache key calculation at #17243. But at the #36619 , we have did a great refactoring and removed the dependencies to the traffic direction and listener metadata from the FactoryContext. The `get_property` ABI will get attributes from the stream info and stream level context. So, after that, it's unnecessary to use the listener metadata and traffic direction as cache key. And at the #36941, we removed the traffic direction and listener metadata from the cached plugin completely. After that, the traffic direction/metadata make nonsense in the cache key. Risk Level: low. Testing: n/a. Docs Changes: n/a. Release Notes: added. Platform Specific Features: n/a. --------- Signed-off-by: wbpcode <[email protected]>
Commit Message: Expose listener info in stream info.
Additional Description: Add relevant accessors in the access log and CEL attributes.
Risk Level: low
Testing: added
Docs Changes: yes
Release Notes: yes
Fixes: #24303
CC @zirain @wbpcode