Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 2 additions & 4 deletions api/envoy/config/filter/http/grpc_stats/v2alpha/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ message FilterConfig {
//
// .. attention::
// If neither `individual_method_stats_allowlist` nor `stats_for_all_methods` is set, the
// behavior will default to `stats_for_all_methods=true`. This default value is deprecated,
// and in a future release, if neither field is set, it will default to
// `stats_for_all_methods=false` in order to be safe by default. This behavior can be
// controlled with runtime override
// behavior will default to `stats_for_all_methods=false`. This default value is changed due
// to the previous value being deprecated. This behavior can be changed with runtime override
// `envoy.deprecated_features.grpc_stats_filter_enable_stats_for_all_methods_by_default`.
google.protobuf.BoolValue stats_for_all_methods = 3;
}
Expand Down
6 changes: 2 additions & 4 deletions api/envoy/extensions/filters/http/grpc_stats/v3/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ message FilterConfig {
//
// .. attention::
// If neither `individual_method_stats_allowlist` nor `stats_for_all_methods` is set, the
// behavior will default to `stats_for_all_methods=true`. This default value is deprecated,
// and in a future release, if neither field is set, it will default to
// `stats_for_all_methods=false` in order to be safe by default. This behavior can be
// controlled with runtime override
// behavior will default to `stats_for_all_methods=false`. This default value is changed due
// to the previous value being deprecated. This behavior can be changed with runtime override
// `envoy.deprecated_features.grpc_stats_filter_enable_stats_for_all_methods_by_default`.
google.protobuf.BoolValue stats_for_all_methods = 3;
}
Expand Down
5 changes: 5 additions & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Incompatible Behavior Changes
-----------------------------
*Changes that are expected to cause an incompatibility if applicable; deployment changes are likely required*

* grpc_stats: the default value for :ref:`stats_for_all_methods <envoy_v3_api_field_extensions.filters.http.grpc_stats.v3.FilterConfig.stats_for_all_methods>` is switched
from true to false, in order to avoid possible memory exhaustion due to an untrusted downstream sending a large number of unique method names. The previous
default value was deprecated in version 1.14.0. This only changes the behavior when the value is not set. The previous behavior can be used by setting the value
to true. This behavior change by be overridden by setting enabling runtime feature `envoy.deprecated_features.grpc_stats_filter_enable_stats_for_all_methods_by_default`.

Minor Behavior Changes
----------------------
*Changes that may cause incompatibilities for some users, but should not for most*
Expand Down
1 change: 1 addition & 0 deletions generated_api_shadow/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ proto_library(
"//envoy/extensions/common/tap/v3:pkg",
"//envoy/extensions/compression/gzip/compressor/v3:pkg",
"//envoy/extensions/compression/gzip/decompressor/v3:pkg",
"//envoy/extensions/filters/common/dependency/v3:pkg",
"//envoy/extensions/filters/common/fault/v3:pkg",
"//envoy/extensions/filters/common/matcher/action/v3:pkg",
"//envoy/extensions/filters/http/adaptive_concurrency/v3:pkg",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct Config {
// set.
//
// This will flip to false after one release.
const bool runtime_feature_default = true;
const bool runtime_feature_default = false;

const char* runtime_key = "envoy.deprecated_features.grpc_stats_filter_enable_"
"stats_for_all_methods_by_default";
Expand Down
14 changes: 5 additions & 9 deletions test/extensions/filters/http/grpc_stats/config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,29 +243,25 @@ TEST_F(GrpcStatsFilterConfigTest, StatsForAllMethodsDefaultSetting) {
deprecatedFeatureEnabled(
"envoy.deprecated_features.grpc_stats_filter_enable_stats_for_all_methods_by_default", _))
.WillOnce(Invoke([](absl::string_view, bool default_value) { return default_value; }));
EXPECT_LOG_CONTAINS("warn",
"Using deprecated default value for "
"'envoy.extensions.filters.http.grpc_stats.v3.FilterConfig.stats_for_all_"
"methods'",
initialize());
initialize();

Http::TestRequestHeaderMapImpl request_headers{{"content-type", "application/grpc"},
{":path", "/BadCompanions/GetBadCompanions"}};

doRequestResponse(request_headers);

EXPECT_EQ(1UL, decoder_callbacks_.clusterInfo()
EXPECT_EQ(0UL, decoder_callbacks_.clusterInfo()
->statsScope()
.counterFromString("grpc.BadCompanions.GetBadCompanions.success")
.value());
EXPECT_EQ(1UL, decoder_callbacks_.clusterInfo()
EXPECT_EQ(0UL, decoder_callbacks_.clusterInfo()
->statsScope()
.counterFromString("grpc.BadCompanions.GetBadCompanions.total")
.value());
EXPECT_EQ(
0UL,
1UL,
decoder_callbacks_.clusterInfo()->statsScope().counterFromString("grpc.success").value());
EXPECT_EQ(0UL,
EXPECT_EQ(1UL,
decoder_callbacks_.clusterInfo()->statsScope().counterFromString("grpc.total").value());
}

Expand Down