5

我们刚刚在我们的服务器上安装了 Application Insights。

一切似乎都运行良好,但服务器上抛出的异常没有显示在门户中。

我们正在使用自定义工具记录异常,但我们也希望能够在 AI 中看到它们,尤其是未处理的异常。

这是在 Windows Server 2012 上简单安装的 AI 代理。

ApplicationInsigts.confg:

<?xml version="1.0" encoding="utf-8"?>
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">
  <!-- 
    Learn more about Application Insights configuration with ApplicationInsights.config here: 
    http://go.microsoft.com/fwlink/?LinkID=392530
  -->
  <TelemetryChannel>
    <DeveloperMode>false</DeveloperMode>
  </TelemetryChannel>
  <TelemetryModules>
    <Add Type="Microsoft.ApplicationInsights.Tracing.DiagnosticsTelemetryModule, Microsoft.ApplicationInsights" />
    <Add Type="Microsoft.ApplicationInsights.Web.RequestTracking.TelemetryModules.WebRequestTrackingTelemetryModule, Microsoft.ApplicationInsights.Web" />
    <Add Type="Microsoft.ApplicationInsights.Web.RequestTracking.TelemetryModules.WebExceptionTrackingTelemetryModule, Microsoft.ApplicationInsights.Web" />
    <Add Type="Microsoft.ApplicationInsights.Web.RequestTracking.TelemetryModules.WebSessionTrackingTelemetryModule, Microsoft.ApplicationInsights.Web" />
    <Add Type="Microsoft.ApplicationInsights.Web.RequestTracking.TelemetryModules.WebUserTrackingTelemetryModule, Microsoft.ApplicationInsights.Web" />
    <Add Type="Microsoft.ApplicationInsights.RuntimeTelemetry.RemoteDependencyModule, Microsoft.ApplicationInsights.RuntimeTelemetry" />
    <Add Type="Microsoft.ApplicationInsights.RuntimeTelemetry.ApmcModule, Microsoft.ApplicationInsights.RuntimeTelemetry" />
  </TelemetryModules>
  <ContextInitializers>
    <Add Type="Microsoft.ApplicationInsights.Contexts.ComponentContextInitializer, Microsoft.ApplicationInsights" />
    <Add Type="Microsoft.ApplicationInsights.Contexts.DeviceContextInitializer, Microsoft.ApplicationInsights" />
    <Add Type="Microsoft.ApplicationInsights.Web.AzureRoleEnvironmentContextInitializer, Microsoft.ApplicationInsights.Web" />
  </ContextInitializers>
  <TelemetryInitializers>
    <Add Type="Microsoft.ApplicationInsights.Core.TimestampPropertyInitializer, Microsoft.ApplicationInsights" />
    <Add Type="Microsoft.ApplicationInsights.Contexts.NetBiosMachineNameTelemetryInitializer, Microsoft.ApplicationInsights" />
    <Add Type="Microsoft.ApplicationInsights.Contexts.OperatingSystemTelemetryInitializer, Microsoft.ApplicationInsights" />
    <Add Type="Microsoft.ApplicationInsights.Contexts.ProcessIdTelemetryInitializer, Microsoft.ApplicationInsights" />
    <Add Type="Microsoft.ApplicationInsights.Contexts.ProcessNameTelemetryInitializer, Microsoft.ApplicationInsights" />
    <Add Type="Microsoft.ApplicationInsights.Contexts.ThreadIdTelemetryInitializer, Microsoft.ApplicationInsights" />
    <Add Type="Microsoft.ApplicationInsights.Contexts.ThreadLanguageTelemetryInitializer, Microsoft.ApplicationInsights" />
    <Add Type="Microsoft.ApplicationInsights.Web.TelemetryInitializers.WebOperationNameTelemetryInitializer, Microsoft.ApplicationInsights.Web" />
    <Add Type="Microsoft.ApplicationInsights.Web.TelemetryInitializers.WebOperationIdTelemetryInitializer, Microsoft.ApplicationInsights.Web" />
  </TelemetryInitializers>
  <InstrumentationKey>....</InstrumentationKey>
  <ResourceID>.....</ResourceID>
  <StatusMonitor>0.10.0-build23829</StatusMonitor>
</ApplicationInsights>

在此处输入图像描述

4

2 回答 2

3

There is a blog post that describes what is collected out of the box and what you need to do in other cases: http://blogs.msdn.com/b/visualstudioalm/archive/2014/12/12/application-insights-exception-telemetry.aspx

于 2015-04-14T04:54:14.390 回答
1

AI 不会看到您可能在任何全局异常处理程序中处理的异常。我怀疑这可能有助于你找到什么。如果您确实使用全局异常处理程序,您可以在处理程序中使用 AI SDK 中的 TrackException,然后将它们发送给 AI。

于 2014-11-07T00:20:32.107 回答