Skip to content

Commit 4514ffc

Browse files
committed
COMPASS-2750: Adding agg pipeline telemetry data
1 parent 9f9bffc commit 4514ffc

File tree

4 files changed

+49
-5
lines changed

4 files changed

+49
-5
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
"url": "git://github.com/10gen/compass.git"
211211
},
212212
"dependencies": {
213-
"@mongodb-js/compass-aggregations": "^0.2.6",
213+
"@mongodb-js/compass-aggregations": "^0.2.7",
214214
"@mongodb-js/compass-auth-kerberos": "^0.1.0",
215215
"@mongodb-js/compass-auth-ldap": "^0.1.0",
216216
"@mongodb-js/compass-auth-x509": "^0.1.0",

src/internal-plugins/metrics/lib/features.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,21 @@ const DocumentResource = BaseResource.extend({
139139
}
140140
});
141141

142+
// Aggregation resource.
143+
const AggregationResource = BaseResource.extend({
144+
id: 'Aggregation',
145+
eventTrackers: ['stitch'],
146+
executed: function(metadata, callback) {
147+
this._send_event(metadata, callback);
148+
},
149+
saved: function(metadata, callback) {
150+
this._send_event(metadata, callback);
151+
},
152+
deleted: function(metadata, callback) {
153+
this._send_event(metadata, callback);
154+
}
155+
});
156+
142157
// Resource for the connect window.
143158
const ConnectResource = BaseResource.extend({
144159
id: 'Connect',
@@ -241,6 +256,7 @@ featureResources['Validation Rules'] = new ValidationRulesResource();
241256
featureResources.Explain = new ExplainResource();
242257
featureResources.Import = new ImportResource();
243258
featureResources.Export = new ExportResource();
259+
featureResources.Aggregation = new AggregationResource();
244260
featureResources.Document = new DocumentResource();
245261
featureResources.Documents = new DocumentsResource();
246262
featureResources.DocumentsListView = new DocumentsListViewResource();

src/internal-plugins/metrics/lib/rules.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,34 @@ module.exports = [
238238
condition: () => true,
239239
metadata: () => ({})
240240
},
241+
{
242+
registryEvent: 'agg-pipeline-executed',
243+
resource: 'Aggregation',
244+
action: 'executed',
245+
condition: () => true,
246+
metadata: (data) => ({
247+
numStages: data.numStages,
248+
stageOperators: data.stageOperators
249+
})
250+
},
251+
{
252+
registryEvent: 'agg-pipeline-saved',
253+
resource: 'Aggregation',
254+
action: 'saved',
255+
condition: () => true,
256+
metadata: (data) => ({
257+
name: data.name
258+
})
259+
},
260+
{
261+
registryEvent: 'agg-pipeline-deleted',
262+
resource: 'Aggregation',
263+
action: 'deleted',
264+
condition: () => true,
265+
metadata: (data) => ({
266+
name: data.name
267+
})
268+
},
241269
{
242270
store: 'License.Store',
243271
resource: 'License',

0 commit comments

Comments
 (0)