cliffordfajardo commented on code in PR #2408:
URL: https://github.com/apache/helix/pull/2408#discussion_r1136035224


##########
helix-front/server/app.ts:
##########
@@ -7,10 +7,26 @@ import fs from 'fs';
 import http from 'http';
 import https from 'https';
 import session from 'express-session';
+import appInsights from 'applicationinsights';
 
-import { SSL, SESSION_STORE } from './config';
+import { APP_INSIGHTS_KEY, SSL, SESSION_STORE } from './config';
 import setRoutes from './routes';
 
+if (APP_INSIGHTS_KEY) {
+  appInsights
+    .setup(APP_INSIGHTS_KEY)
+    .setAutoDependencyCorrelation(true)
+    .setAutoCollectRequests(true)
+    .setAutoCollectPerformance(true, true)
+    .setAutoCollectExceptions(true)
+    .setAutoCollectDependencies(true)
+    .setAutoCollectConsole(true)
+    .setUseDiskRetryCaching(true)
+    .setSendLiveMetrics(false)
+    .setDistributedTracingMode(appInsights.DistributedTracingModes.AI)
+    .start();
+}
+
 const app = express();
 const server = http.createServer(app);

Review Comment:
   If you're waiting for App insights to be provisioned still, 
   I recommend using a personal email account to access to App Insights so you 
can test locally
   
   When I set it up in [this Github 
PR](https://linkedin.ghe.com/multiproduct/sdi-infra-fe/pull/244), that's what I 
did to verify the code worked and that the metrics were being reported to Azure 
App insights UI 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to