mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-18 16:31:31 +00:00
Initial Portal Runner (#51)
This commit is contained in:
15
test/utils.js
Normal file
15
test/utils.js
Normal file
@@ -0,0 +1,15 @@
|
||||
let client;
|
||||
const appInsightsKey = process.env.PORTAL_RUNNER_APP_INSIGHTS_KEY;
|
||||
if (!appInsightsKey) {
|
||||
console.warn(`PORTAL_RUNNER_APP_INSIGHTS_KEY env var not set. Runner telemetry will not be reported`);
|
||||
} else {
|
||||
const appInsights = require("applicationinsights");
|
||||
appInsights.setup(process.env.PORTAL_RUNNER_APP_INSIGHTS_KEY).start();
|
||||
client = appInsights.defaultClient;
|
||||
}
|
||||
|
||||
module.exports.trackEvent = (...args) => {
|
||||
if (client) {
|
||||
client.trackEvent(...args);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user