Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Commit 387e0d2

Browse files
authored
COMPASS-4116: Fix/Update datalake telemetry reporting by using mongodb-build-info package (#242)
1 parent 6603f07 commit 387e0d2

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

lib/instance-detail-helper.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const toNS = require('mongodb-ns');
44
const security = require('mongodb-security');
55
const ReadPreference = require('mongodb').ReadPreference;
66
const URL = require('mongodb-url');
7+
const getMongoDBBuildInfo = require('mongodb-build-info');
78
const {
89
union,
910
map,
@@ -142,18 +143,15 @@ function getGenuineMongoDB(results, done) {
142143
function getDataLake(results, done) {
143144
const buildInfo = results.build.raw;
144145

145-
debug('isDataLake check: buildInfo.queryEngine', buildInfo.queryEngine);
146+
debug('isDataLake check: buildInfo.dataLake', buildInfo.dataLake);
147+
148+
const { isDataLake, dlVersion } = getMongoDBBuildInfo.getDataLake(buildInfo);
146149

147150
const res = {
148-
isDataLake: false,
149-
version: null
151+
isDataLake,
152+
version: dlVersion
150153
};
151154

152-
if (buildInfo.queryEngine) {
153-
res.isDataLake = true;
154-
res.version = buildInfo.queryEngine.version;
155-
}
156-
157155
done(null, res);
158156
}
159157

package-lock.json

Lines changed: 5 additions & 0 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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"debug": "^4.1.1",
2525
"lodash": "^4.17.15",
2626
"mongodb": "^3.5.7",
27+
"mongodb-build-info": "^1.1.0",
2728
"mongodb-collection-sample": "^4.5.1",
2829
"mongodb-connection-model": "^16.1.4",
2930
"mongodb-index-model": "^2.6.1",

test/instance-detail-helper-mocked.test.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,18 @@ describe('instance-detail-helper-mocked', function() {
233233
describe('getDataLake', function() {
234234
it('reports when connected to DataLake', function(done) {
235235
const results = {
236-
build: { raw: { queryEngine: { version: '1.0.0' } } }
236+
build: { raw: {
237+
dataLake: {
238+
version: 'v20200329',
239+
gitVersion: '0f318ss78bfad79ede3721e91iasj6f61644f',
240+
date: '2020-03-29T15:41:22Z'
241+
}
242+
} }
237243
};
238244
getDataLake(results, function(err, res) {
239245
assert.equal(err, null);
240246
assert.equal(res.isDataLake, true);
241-
assert.equal(res.version, '1.0.0');
247+
assert.equal(res.version, 'v20200329');
242248
done();
243249
});
244250
});

0 commit comments

Comments
 (0)