diff options
author | Will Buerger <will.buerger@mongodb.com> | 2023-05-05 13:36:36 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-05-05 16:42:44 +0000 |
commit | 72e24ba9bbc1c3043d35d47e30cda75075ff3d95 (patch) | |
tree | 4673ecbe265e23f3a01cac1e187c0290c71110a3 /src/mongo/db/pipeline/aggregate_request_shapifier.cpp | |
parent | d66daf618a9005eaba4a8c9fa3746ef27ab80427 (diff) | |
download | mongo-72e24ba9bbc1c3043d35d47e30cda75075ff3d95.tar.gz |
SERVER-76557: Keep RequestShapifiers in telemetry store
Diffstat (limited to 'src/mongo/db/pipeline/aggregate_request_shapifier.cpp')
-rw-r--r-- | src/mongo/db/pipeline/aggregate_request_shapifier.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/aggregate_request_shapifier.cpp b/src/mongo/db/pipeline/aggregate_request_shapifier.cpp index 74d9214cd65..40ed6c2ce79 100644 --- a/src/mongo/db/pipeline/aggregate_request_shapifier.cpp +++ b/src/mongo/db/pipeline/aggregate_request_shapifier.cpp @@ -33,11 +33,22 @@ namespace mongo::telemetry { +BSONObj AggregateRequestShapifier::makeTelemetryKey(const SerializationOptions& opts, + OperationContext* opCtx) const { + // TODO SERVER-76087 We will likely want to set a flag here to stop $search from calling out + // to mongot. + auto expCtx = make_intrusive<ExpressionContext>(opCtx, nullptr, _request.getNamespace()); + expCtx->variables.setDefaultRuntimeConstants(opCtx); + expCtx->maxFeatureCompatibilityVersion = boost::none; // Ensure all features are allowed. + expCtx->stopExpressionCounters(); + return makeTelemetryKey(opts, expCtx); +} + BSONObj AggregateRequestShapifier::makeTelemetryKey( const SerializationOptions& opts, const boost::intrusive_ptr<ExpressionContext>& expCtx) const { BSONObjBuilder bob; - // TODO SERVER-76557 move actually pipeline serialization into query_shape + // TODO SERVER-73152 move pipeline serialization into query_shape::extractQueryShape auto serializedPipeline = _pipeline.serializeToBson(opts); bob.append("queryShape", query_shape::extractQueryShape(_request, serializedPipeline, opts, expCtx)); |