Skip to content

Commit 9d8e976

Browse files
authored
chore(hadron-plugin-manager): add external plugin telemetry COMPASS-5202 (#2548)
1 parent bf5eef0 commit 9d8e976

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

package-lock.json

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

packages/hadron-plugin-manager/lib/plugin-manager.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ const path = require('path');
55
const Plugin = require('./plugin');
66
const Action = require('./action');
77

8-
const debug = require('debug')('hadron-plugin-manager:manager');
8+
const { createLoggerAndTelemetry } = require('@mongodb-js/compass-logging');
9+
const { debug, track } = createLoggerAndTelemetry('COMPASS-PLUGINS');
910

1011
/**
1112
* Manages plugins in the application.
@@ -67,6 +68,7 @@ class PluginManager {
6768

6869
async _loadPlugin(pluginPath, apiVersion) {
6970
debug('Loading plugin from path', pluginPath);
71+
track('External Plugin Loaded');
7072
try {
7173
const plugin = new Plugin(pluginPath, apiVersion);
7274
this.plugins.push(plugin);

packages/hadron-plugin-manager/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
},
3838
"devDependencies": {
3939
"@external-plugins/example3": "file:./test/external-plugins/example3",
40+
"@mongodb-js/compass-logging": "^0.3.0",
4041
"chai": "^3.4.1",
4142
"depcheck": "^1.4.1",
4243
"eslint": "^7.25.0",

0 commit comments

Comments
 (0)