summaryrefslogtreecommitdiff
path: root/src/mongo/s/query/cluster_aggregate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/query/cluster_aggregate.cpp')
-rw-r--r--src/mongo/s/query/cluster_aggregate.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/s/query/cluster_aggregate.cpp b/src/mongo/s/query/cluster_aggregate.cpp
index 5550b177258..5537e4effb3 100644
--- a/src/mongo/s/query/cluster_aggregate.cpp
+++ b/src/mongo/s/query/cluster_aggregate.cpp
@@ -55,6 +55,7 @@
#include "mongo/db/query/explain_common.h"
#include "mongo/db/query/find_common.h"
#include "mongo/db/query/fle/server_rewrite.h"
+#include "mongo/db/query/telemetry.h"
#include "mongo/db/timeseries/timeseries_gen.h"
#include "mongo/db/timeseries/timeseries_options.h"
#include "mongo/db/views/resolved_view.h"
@@ -331,6 +332,10 @@ Status ClusterAggregate::runAggregate(OperationContext* opCtx,
auto shouldDoFLERewrite = ::mongo::shouldDoFLERewrite(request);
auto startsWithDocuments = liteParsedPipeline.startsWithDocuments();
+ if (!shouldDoFLERewrite) {
+ telemetry::registerAggRequest(request, opCtx);
+ }
+
// If the routing table is not already taken by the higher level, fill it now.
if (!cm) {
// If the routing table is valid, we obtain a reference to it. If the table is not valid,
@@ -553,6 +558,7 @@ Status ClusterAggregate::runAggregate(OperationContext* opCtx,
updateHostsTargetedMetrics(opCtx, namespaces.executionNss, cm, involvedNamespaces);
// Report usage statistics for each stage in the pipeline.
liteParsedPipeline.tickGlobalStageCounters();
+ telemetry::recordExecution(opCtx, shouldDoFLERewrite);
// Add 'command' object to explain output.
if (expCtx->explain) {