From f686154c7dcab57316dba532f06d41201fba6b82 Mon Sep 17 00:00:00 2001 From: mathisbessamdb Date: Tue, 16 May 2023 19:16:55 +0000 Subject: SERVER-76900 ResourceConsumption::shouldCollectMetricsForDatabase to pass a DatabaseName --- src/mongo/db/service_entry_point_common.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/service_entry_point_common.cpp') diff --git a/src/mongo/db/service_entry_point_common.cpp b/src/mongo/db/service_entry_point_common.cpp index 11a859255fb..f39f599eeb7 100644 --- a/src/mongo/db/service_entry_point_common.cpp +++ b/src/mongo/db/service_entry_point_common.cpp @@ -1510,7 +1510,10 @@ void ExecCommandDatabase::_initiateCommand() { // Connections from mongod or mongos clients (i.e. initial sync, mirrored reads, etc.) should // not contribute to resource consumption metrics. const bool collect = command->collectsResourceConsumptionMetrics() && !_isInternalClient(); - _scopedMetrics.emplace(opCtx, dbname, collect); + _scopedMetrics.emplace( + opCtx, + DatabaseNameUtil::deserialize(request.getValidatedTenantId(), request.getDatabase()), + collect); const auto allowTransactionsOnConfigDatabase = (serverGlobalParams.clusterRole.has(ClusterRole::ConfigServer) || -- cgit v1.2.1