You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "helix-bot (via GitHub)" <gi...@apache.org> on 2023/03/24 16:18:24 UTC

[GitHub] [helix] helix-bot commented on a diff in pull request #2417: Setup optional proxy agent for use with App Insights

helix-bot commented on code in PR #2417:
URL: https://github.com/apache/helix/pull/2417#discussion_r1147800546


##########
helix-front/server/app.ts:
##########
@@ -27,6 +35,17 @@ if (APP_INSIGHTS_CONNECTION_STRING) {
     .start();
 }
 
+if (httpsProxyAgent && process.env.NODE_ENV === 'production') {
+  // NOTES:
+  //
+  // - `defaultClient` property on `appInsights` doesn't exist
+  // until `.start` is called
+  //
+  // - in development on our laptop (as opposed to a server)
+  // we don't need to go through a proxy.
+  appInsights.defaultClient.config.httpsAgent = httpsProxyAgent;
+}
+
 const app = express();
 const server = http.createServer(app);
 

Review Comment:
   Thanks for this idea!



-- 
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: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org