// server.js
app.all("*", (req, res, next) => {
/**
* App insights normally would track all requests by default after initialization, but for some reason its not working in this app.
* I have manually called `trackNodeHttpRequest` below to get all our requests/responses analyzed and showing up on our dashboard.
* https://github.com/microsoft/ApplicationInsights-node.js
*/
appInsights.defaultClient.trackNodeHttpRequest({
request: req,
response: res
});
})
1条答案
按热度按时间bkkx9g8r1#
由于某种原因,库没有正确注册来捕获我传入和传出的http请求。为了解决这个问题,我不得不在应用的根目录下手动跟踪请求/响应,如下所示:
我的实际server.js代码文件:https://github.com/remix-run/remix/discussions/4499