Skip to content

Commit

Permalink
Fix extension monitor name
Browse files Browse the repository at this point in the history
Signed-off-by: Kateryna Nezdolii <kateryna.nezdolii@gmail.com>
  • Loading branch information
nezdolik committed Jul 23, 2024
1 parent c3241e4 commit e54bf02
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/res
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Downstream connections]
// [#extension: envoy.resource_monitors.downstream_connections]
// [#extension: envoy.resource_monitors.global_downstream_max_connections]

// The downstream connections resource monitor tracks the global number of open downstream connections.
message DownstreamConnectionsConfig {
Expand Down
2 changes: 1 addition & 1 deletion source/extensions/extensions_build_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ EXTENSIONS = {

"envoy.resource_monitors.fixed_heap": "//source/extensions/resource_monitors/fixed_heap:config",
"envoy.resource_monitors.injected_resource": "//source/extensions/resource_monitors/injected_resource:config",
"envoy.resource_monitors.downstream_connections": "//source/extensions/resource_monitors/downstream_connections:config",
"envoy.resource_monitors.global_downstream_max_connections": "//source/extensions/resource_monitors/downstream_connections:config",

#
# Stat sinks
Expand Down
2 changes: 1 addition & 1 deletion source/extensions/extensions_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ envoy.request_id.uuid:
status: stable
type_urls:
- envoy.extensions.request_id.uuid.v3.UuidRequestIdConfig
envoy.resource_monitors.downstream_connections:
envoy.resource_monitors.global_downstream_max_connections:
categories:
- envoy.resource_monitors
security_posture: data_plane_agnostic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ActiveDownstreamConnectionsMonitorFactory
DownstreamConnectionsConfig> {
public:
ActiveDownstreamConnectionsMonitorFactory()
: ProactiveFactoryBase("envoy.resource_monitors.downstream_connections") {}
: ProactiveFactoryBase("envoy.resource_monitors.global_downstream_max_connections") {}

private:
Server::ProactiveResourceMonitorPtr createProactiveResourceMonitorFromProtoTyped(
Expand Down
4 changes: 2 additions & 2 deletions source/server/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ void InstanceBase::onRuntimeReady() {
if (runtime().snapshot().get(Runtime::Keys::GlobalMaxCxRuntimeKey)) {
ENVOY_LOG(warn,
"Usage of the deprecated runtime key {}, consider switching to "
"`envoy.resource_monitors.downstream_connections` instead."
"`envoy.resource_monitors.global_downstream_max_connections` instead."
"This runtime key will be removed in future.",
Runtime::Keys::GlobalMaxCxRuntimeKey);
}
Expand Down Expand Up @@ -933,7 +933,7 @@ RunHelper::RunHelper(Instance& instance, const Options& options, Event::Dispatch
Server::OverloadProactiveResourceName::GlobalDownstreamMaxConnections)) {
ENVOY_LOG(warn, "There is no configured limit to the number of allowed active downstream "
"connections. Configure a "
"limit in `envoy.resource_monitors.downstream_connections` resource monitor.");
"limit in `envoy.resource_monitors.global_downstream_max_connections` resource monitor.");
}

// Register for cluster manager init notification. We don't start serving worker traffic until
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ envoy_package()
envoy_extension_cc_test(
name = "downstream_connections_monitor_test",
srcs = ["downstream_connections_monitor_test.cc"],
extension_names = ["envoy.resource_monitors.downstream_connections"],
extension_names = ["envoy.resource_monitors.global_downstream_max_connections"],
external_deps = ["abseil_optional"],
deps = [
"//source/extensions/resource_monitors/downstream_connections:downstream_connections_monitor",
Expand All @@ -26,7 +26,7 @@ envoy_extension_cc_test(
envoy_extension_cc_test(
name = "config_test",
srcs = ["config_test.cc"],
extension_names = ["envoy.resource_monitors.downstream_connections"],
extension_names = ["envoy.resource_monitors.global_downstream_max_connections"],
deps = [
"//envoy/registry",
"//source/extensions/resource_monitors/downstream_connections:config",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ namespace {
TEST(ActiveDownstreamConnectionsMonitorFactoryTest, CreateMonitorInvalidConfig) {
auto factory =
Registry::FactoryRegistry<Server::Configuration::ProactiveResourceMonitorFactory>::getFactory(
"envoy.resource_monitors.downstream_connections");
"envoy.resource_monitors.global_downstream_max_connections");
ASSERT_NE(factory, nullptr);
EXPECT_EQ("envoy.resource_monitors.downstream_connections", factory->name());
EXPECT_EQ("envoy.resource_monitors.global_downstream_max_connections", factory->name());

envoy::extensions::resource_monitors::downstream_connections::v3::DownstreamConnectionsConfig
config;
Expand All @@ -42,9 +42,9 @@ TEST(ActiveDownstreamConnectionsMonitorFactoryTest, CreateMonitorInvalidConfig)
TEST(ActiveDownstreamConnectionsMonitorFactoryTest, CreateCustomMonitor) {
auto factory =
Registry::FactoryRegistry<Server::Configuration::ProactiveResourceMonitorFactory>::getFactory(
"envoy.resource_monitors.downstream_connections");
"envoy.resource_monitors.global_downstream_max_connections");
ASSERT_NE(factory, nullptr);
EXPECT_EQ("envoy.resource_monitors.downstream_connections", factory->name());
EXPECT_EQ("envoy.resource_monitors.global_downstream_max_connections", factory->name());

envoy::extensions::resource_monitors::downstream_connections::v3::DownstreamConnectionsConfig
config;
Expand All @@ -61,7 +61,7 @@ TEST(ActiveDownstreamConnectionsMonitorFactoryTest, CreateCustomMonitor) {
TEST(ActiveDownstreamConnectionsMonitorFactoryTest, CreateDefaultMonitor) {
auto factory =
Registry::FactoryRegistry<Server::Configuration::ProactiveResourceMonitorFactory>::getFactory(
"envoy.resource_monitors.downstream_connections");
"envoy.resource_monitors.global_downstream_max_connections");
ASSERT_NE(factory, nullptr);

Event::MockDispatcher dispatcher;
Expand Down
4 changes: 2 additions & 2 deletions test/integration/cx_limit_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ TEST_P(ConnectionLimitIntegrationTest, TestDeprecationWarningForGlobalCxRuntimeL
};
const std::string log_line =
"Usage of the deprecated runtime key overload.global_downstream_max_connections, "
"consider switching to `envoy.resource_monitors.downstream_connections` instead."
"consider switching to `envoy.resource_monitors.global_downstream_max_connections` instead."
"This runtime key will be removed in future.";
EXPECT_LOG_CONTAINS("warn", log_line, { init_func(); });
}
Expand All @@ -154,7 +154,7 @@ TEST_P(ConnectionLimitIntegrationTest, TestEmptyGlobalCxRuntimeLimit) {
const std::string log_line =
"There is no configured limit to the number of allowed active downstream connections. "
"Configure a "
"limit in `envoy.resource_monitors.downstream_connections` resource monitor.";
"limit in `envoy.resource_monitors.global_downstream_max_connections` resource monitor.";
EXPECT_LOG_CONTAINS("warn", log_line, { initialize(); });
}

Expand Down

0 comments on commit e54bf02

Please sign in to comment.