diff options
author | Vojislav Stojkovic <vojislav.stojkovic@mongodb.com> | 2022-10-20 20:27:19 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-10-20 21:59:20 +0000 |
commit | 9027627ca94b5dbdcd741fcb520c45ee2dcbd184 (patch) | |
tree | 5c7c709076521508d788a22d849fce00a3fcb44c /src/mongo/s/mongos_main.cpp | |
parent | 2de14f9eec1efcb0c9663cdf84760156ff1de196 (diff) | |
download | mongo-9027627ca94b5dbdcd741fcb520c45ee2dcbd184.tar.gz |
SERVER-67887 Add metrics for the first non-auth command on an ingress connection
Diffstat (limited to 'src/mongo/s/mongos_main.cpp')
-rw-r--r-- | src/mongo/s/mongos_main.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/s/mongos_main.cpp b/src/mongo/s/mongos_main.cpp index 12fe89260f0..6a07b0a1ea0 100644 --- a/src/mongo/s/mongos_main.cpp +++ b/src/mongo/s/mongos_main.cpp @@ -51,6 +51,7 @@ #include "mongo/db/change_stream_options_manager.h" #include "mongo/db/client.h" #include "mongo/db/client_metadata_propagation_egress_hook.h" +#include "mongo/db/commands.h" #include "mongo/db/dbdirectclient.h" #include "mongo/db/ftdc/ftdc_mongos.h" #include "mongo/db/initialize_server_global_state.h" @@ -102,6 +103,7 @@ #include "mongo/scripting/dbdirectclient_factory.h" #include "mongo/scripting/engine.h" #include "mongo/stdx/thread.h" +#include "mongo/transport/session_auth_metrics.h" #include "mongo/transport/transport_layer_manager.h" #include "mongo/util/admin_access.h" #include "mongo/util/cmdline_utils/censor_cmdline.h" @@ -747,6 +749,9 @@ ExitCode runMongosServer(ServiceContext* serviceContext) { "error"_attr = redact(ex)); } + CommandInvocationHooks::set(serviceContext, + std::make_unique<transport::SessionAuthMetricsCommandHooks>()); + startMongoSFTDC(); if (mongosGlobalParams.scriptingEnabled) { |