Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Fixed the stats scope that is used to create the gRPC client of the external processing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems to be a minor behavior change. Please move the release log to the minor_behavior_change section.

(``ext_proc``) filter. Previously the filter's own scope was used, so the gRPC client stats
gained an unexpected extra prefix,
``cluster.<cluster_name>.`` for an upstream filter. The server scope is now used, so the Google
gRPC client stats are emitted with the expected ``grpc.<google_grpc_stat_prefix>.`` prefix.
12 changes: 8 additions & 4 deletions source/extensions/filters/http/ext_proc/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,14 @@ ExternalProcessingFilterConfig::createHttpFilterFactoryFromProtoTyped(
config_creation_status);
RETURN_IF_NOT_OK_REF(config_creation_status);
if (proto_config.has_grpc_service()) {
return [filter_config = std::move(filter_config), &context,
scope](Http::FilterChainFactoryCallbacks& callbacks) {
auto client =
createExternalProcessorClient(context.clusterManager().grpcAsyncClientManager(), *scope);
return [filter_config = std::move(filter_config),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add a unit test in config_test.cc to verify the change.

&context](Http::FilterChainFactoryCallbacks& callbacks) {
// The google gRPC client will create a fresh scope for its stats from the input scope and use
// 'grpc.<google_grpc_stat_prefix>.' as the prefix.
// To avoid unexpected additional prefixes like 'http.<connection_manager>' or
// 'cluster.<cluster_name>', the server scope here is used.
auto client = createExternalProcessorClient(context.clusterManager().grpcAsyncClientManager(),
context.scope());
callbacks.addStreamFilter(
Http::StreamFilterSharedPtr{std::make_shared<Filter>(filter_config, std::move(client))});
};
Expand Down
Loading