diff --git a/docs/root/version_history/current.rst b/docs/root/version_history/current.rst index 9f73da49511a..4bfc93a81324 100644 --- a/docs/root/version_history/current.rst +++ b/docs/root/version_history/current.rst @@ -20,6 +20,7 @@ Minor Behavior Changes * jwt_authn filter: added support of Jwt time constraint verification with a clock skew (default to 60 seconds) and added a filter config field :ref:`clock_skew_seconds ` to configure it. * memory: enable new tcmalloc with restartable sequences for aarch64 builds. * oauth filter: added the optional parameter :ref:`auth_scopes ` with default value of 'user' if not provided. Enables for this value to be overridden in the Authorization request to the OAuth provider. +* mongo proxy metrics: swapped network connection remote and local closed counters previously set reversed (`cx_destroy_local_with_active_rq` and `cx_destroy_remote_with_active_rq`). * tls: removed RSA key transport and SHA-1 cipher suites from the client-side defaults. * watchdog: the watchdog action :ref:`abort_action ` is now the default action to terminate the process if watchdog kill / multikill is enabled. * xds: to support TTLs, heartbeating has been added to xDS. As a result, responses that contain empty resources without updating the version will no longer be propagated to the diff --git a/source/extensions/filters/network/mongo_proxy/proxy.cc b/source/extensions/filters/network/mongo_proxy/proxy.cc index b8ee760c910b..789d6e8df91d 100644 --- a/source/extensions/filters/network/mongo_proxy/proxy.cc +++ b/source/extensions/filters/network/mongo_proxy/proxy.cc @@ -366,11 +366,11 @@ void ProxyFilter::onEvent(Network::ConnectionEvent event) { } if (event == Network::ConnectionEvent::RemoteClose && !active_query_list_.empty()) { - stats_.cx_destroy_local_with_active_rq_.inc(); + stats_.cx_destroy_remote_with_active_rq_.inc(); } if (event == Network::ConnectionEvent::LocalClose && !active_query_list_.empty()) { - stats_.cx_destroy_remote_with_active_rq_.inc(); + stats_.cx_destroy_local_with_active_rq_.inc(); } } diff --git a/test/extensions/filters/network/mongo_proxy/proxy_test.cc b/test/extensions/filters/network/mongo_proxy/proxy_test.cc index 5b20f6cd5106..c43ebe8ca897 100644 --- a/test/extensions/filters/network/mongo_proxy/proxy_test.cc +++ b/test/extensions/filters/network/mongo_proxy/proxy_test.cc @@ -626,8 +626,8 @@ TEST_F(MongoProxyFilterTest, ConnectionDestroyLocal) { EXPECT_CALL(*delay_timer, disableTimer()); read_filter_callbacks_.connection_.raiseEvent(Network::ConnectionEvent::RemoteClose); - EXPECT_EQ(1U, store_.counter("test.cx_destroy_local_with_active_rq").value()); - EXPECT_EQ(0U, store_.counter("test.cx_destroy_remote_with_active_rq").value()); + EXPECT_EQ(0U, store_.counter("test.cx_destroy_local_with_active_rq").value()); + EXPECT_EQ(1U, store_.counter("test.cx_destroy_remote_with_active_rq").value()); } TEST_F(MongoProxyFilterTest, ConnectionDestroyRemote) { @@ -650,8 +650,8 @@ TEST_F(MongoProxyFilterTest, ConnectionDestroyRemote) { EXPECT_CALL(*delay_timer, disableTimer()); read_filter_callbacks_.connection_.raiseEvent(Network::ConnectionEvent::LocalClose); - EXPECT_EQ(1U, store_.counter("test.cx_destroy_remote_with_active_rq").value()); - EXPECT_EQ(0U, store_.counter("test.cx_destroy_local_with_active_rq").value()); + EXPECT_EQ(0U, store_.counter("test.cx_destroy_remote_with_active_rq").value()); + EXPECT_EQ(1U, store_.counter("test.cx_destroy_local_with_active_rq").value()); } } // namespace MongoProxy