我在Azure WebJob (.exe)中托管了一些遗留代码,它会生成大量的ETW事件,以便记录到自定义事件提供程序中。
如何以一种简单的方式将这些ETW事件发送到Application Insights?我希望它们出现在与我托管WebJob的网站相同的AI实例中。
发布于 2017-01-28 08:56:40
下面是一个简单的事件源跟踪模块示例。https://github.com/AlexBulankou/ai-samples/blob/master/ETWTrackingModule.cs
该模块包装了订阅已配置事件源的ETW侦听器。您可以指定要订阅的事件源,以及是否希望跟踪事件和/或跟踪ETW事件。在ApplicationInsights.config中,按如下方式注册此模块:
<Add Type="Microsoft.ApplicationInsights.Samples.ETWTrackingModule, YourAssemblyName">
<TrackEvent>True</TrackEvent>
<TrackTrace>True</TrackTrace>
<EventSources>
<Add Name="System.Collections.Concurrent.ConcurrentCollectionsEventSource" EventLevel="LogAlways"/>
<Add Name="System.Diagnostics.Eventing.FrameworkEventSource" EventLevel="LogAlways"/>
</EventSources>
</Add>
https://stackoverflow.com/questions/41893654
复制相似问题