我正在创建一个 Angular 应用程序,并尝试将 appinsights 添加到 Angular 应用程序。配置设置如下:
private config: Microsoft.ApplicationInsights.IConfig = {
instrumentationKey: environment.appInsights.instrumentationKey,
disableCorrelationHeaders: false,
enableDebug : true,
verboseLogging : true
}
应用洞察在 Angular 服务中初始化如下。
if (!AppInsights.config) {
AppInsights.downloadAndSetup(this.config);
}
但我没有看到具有以下 header 的依赖项调用 '请求 ID' '请求上下文'
有人成功地让它发挥作用吗?
最佳答案
另请尝试设置enableCorsCorrelation: true
https://learn.microsoft.com/en-au/azure/azure-monitor/app/javascript#configuration
关于angular - “Request-Id”和 'Request-Context' 未添加,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49725810/