[COMPASS-4116] Telemetry for ADL is wrong Created: 28/Jan/20  Updated: 29/Oct/23  Resolved: 05/Aug/20

Status: Closed
Project: Compass
Component/s: Telemetry Data
Affects Version/s: 1.20.4
Fix Version/s: No version

Type: Bug Priority: Major - P3
Reporter: Massimiliano Marcon Assignee: Rhys Howell
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to COMPASS-4356 Show that Compass is connected to ADL... Closed
is related to COMPASS-4288 Use a single source of truth for coll... Open
Documentation Changes: Not Needed
Sprint: Iteration Icaco

 Description   

When Compass is connected to ADL it reports the following:

{
  "databases_count": 4,
  "namespaces_count": 1,
  "mongodb_version": "3.6.0",
  "enterprise_module": false,
  "longest_database_name_length": 27,
  "longest_collection_name_length": 9,
  "server_architecture": "amd64",
  "server_cpu_cores": 2,
  "server_cpu_frequency_mhz": null,
  "server_memory_gb": 0.2021484375,
  "server_os": "linux",
  "server_arch": "amd64",
  "server_os_family": "linux",
  "is_genuine_mongodb": true,
  "server_name": "mongodb",
  "is_data_lake": false,
  "data_lake_version": null,
  "is_atlas": true,
  "is_localhost": false,
  "compass_version": "1.20.4"
}

Maybe something has changed since when we first implemented it.



 Comments   
Comment by Githook User [ 05/Aug/20 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: COMPASS-4116: Fix/Update datalake telemetry reporting by using mongodb-build-info package (#242)
Branch: master
https://github.com/mongodb-js/data-service/commit/387e0d22f1a50e52812e9033420e8b176a0cbc6d

Comment by Rhys Howell [ 27/Jul/20 ]

Looks like the data lake info is publishing in the telemetry event as `is data lake` and `data lake version`
Looks like mongosh and vscode report datalake as `is_data_lake` and compass `is data lake`.
Could it be a renaming issue in our telemetry pipeline? I don't think I have access to the stitch app with the telemetry events, just the charts/data set with the aggregated analytics. We could rename the events if that's something we want to do.

Here's the event:
https://github.com/mongodb-js/compass-metrics/blob/master/src/modules/rules.js#L84

Followed how our metrics for the connection event are built and emitted, I think I found it a bit hard to follow the connection event bubbling - maybe in future we can make it work without some of the extra hopping between packages, to make it a bit more straight forward and followable.
Here's the current flow:

1. When a connection is connected to in `compass-connect`, a `data-service-connected` event is emitted:
https://github.com/mongodb-js/compass-connect/blob/master/src/stores/index.js#L958

2. `data-service-connected` listened to in `compass-app-stores`
https://github.com/mongodb-js/compass-app-stores/blob/master/src/stores/instance-store.js#L66

3. `compass-app-stores` calls to fetch the connection information in `mongodb-instance-model`:
https://github.com/mongodb-js/compass-app-stores/blob/master/src/stores/instance-store.js#L40
https://github.com/mongodb-js/instance-model/blob/master/lib/extended-model.js#L79

Which calls to build the connection info in the data service:
https://github.com/mongodb-js/data-service/blob/master/lib/data-service.js#L357
https://github.com/mongodb-js/data-service/blob/master/lib/instance-detail-helper.js#L602

4. `compass-app-stores` emits `instance-refreshed` which `compass-metrics` listens to:
https://github.com/mongodb-js/compass-app-stores/blob/master/src/stores/instance-store.js#L85
https://github.com/mongodb-js/compass-metrics/blob/master/src/modules/rules.js#L58

5. `compass-metrics` builds the telemetry event metadata (`is data lake` and `data lake version`)
https://github.com/mongodb-js/compass-metrics/blob/master/src/modules/rules.js#L62

6. `compass-metrics` calls to track the event in `mongodb-js-metrics`
https://github.com/mongodb-js/compass-metrics/blob/master/src/stores/store.js#L22
https://github.com/mongodb-js/metrics/blob/master/lib/resources/base.js#L74

`mongodb-js-metrics` calls the tracker set up in `compass-metrics`, which publishes the event to stitch.
https://github.com/mongodb-js/compass-metrics/blob/master/src/modules/setup.js#L36

Generated at Wed Feb 07 22:35:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.