首页 > 解决方案 > Application Insights:无法验证节点 js 中的第一个证书

问题描述

应用程序见解每隔几分钟就会不断抛出以下错误。

ApplicationInsights:Sender ['连续 5 次无法到达摄取端点。可能会导致遥测丢失。最近的错误:',{ 错误:无法验证 TLSSocket 的第一个证书。\u003canonymous\u003e (_tls_wrap.js:1116:38) 在 ZoneDelegate.invokeTask (/usr/src/app/node_modules/zone.js/dist /zone-node.js:275:35) 在 Zone.runTask (/usr/src/app/node_modules/zone.js/dist/zone-node.js:151:47) 在 TLSSocket.ZoneTask.invoke (/usr /src/app/node_modules/zone.js/dist/zone-node.js:345:33) 在 TLSSocket.emit (events.js:208:7) 在 TLSSocket 的 emitNone (events.js:106:13)。 _finishInit (_tls_wrap.js:643:8) 在 TLSWrap.ssl.onhandshakedone (_tls_wrap.js:473:38) 代码:'UNABLE_TO_VERIFY_LEAF_SIGNATURE'}]

我查看了讨论GITHUB DISCUSSION并尝试了一些建议的解决方案,但没有奏效。

这是我用来连接到应用程序洞察力的代码。

let appInsights = require('applicationinsights');
appInsights.setup(config.APPINSIGHTS_KEY.trim())
  .setAutoDependencyCorrelation(true)
  .setAutoCollectRequests(true)
  .setAutoCollectPerformance(true)
  .setAutoCollectExceptions(true)
  .setAutoCollectDependencies(true)
  .setAutoCollectConsole(true)
  .setUseDiskRetryCaching(true)
  .start();

我不是 100% 确定是否有任何遥测丢失,但总是遇到这些错误很烦人。请帮忙。

标签: node.jsazureazure-application-insights

解决方案


我已经更新了 github 讨论线程。摄取方面的修复工作正在进行中。

https://github.com/Microsoft/ApplicationInsights-node.js/issues/180#issuecomment-475699485


推荐阅读