7

I am using application insights sdk for a wpf app I've been working on to capture some simple telemetry. I am loading the configuration file that looks like this

<?xml version="1.0" encoding="utf-8"?>
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
<TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel"/>
<TelemetryProcessors>
    <Add Type="Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor, Microsoft.ApplicationInsights"/>
    <Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
        <MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond>
        <ExcludedTypes>Event</ExcludedTypes>
    </Add>
    <Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
        <MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond>
        <IncludedTypes>Event</IncludedTypes>
    </Add>
</TelemetryProcessors>

The problem is when I run the installed application and am offline the telemetry is captured just fine. Next time I open the app when I'm online that data eventually gets pushed out to app insights. But when anyone else runs the application offline their data never ends up getting pushed to app insights when they come back online.

Is there something wrong here in the way that this is configured? Why would this work for some users but not others?

edit: Working with a user today I noticed that when they are offline and running the app there is no temporary file that is saved. When I do the same thing on my computer I notice a weird temp file gets created. When I run the app when back online it disappears.

4

2 回答 2

7

在用户的机器上调试并挖掘代码后,我发现服务器遥测通道使用这个函数NetworkInterface.GetIsNetworkAvailable();,即使我的用户离线,它也总是为我的用户返回 true,因为他们有一些额外的网络适配器认为他们连接到未知网络。

于 2018-05-09T03:28:49.157 回答
-1

您是否检查了https://docs.microsoft.com/en-us/azure/application-insights/app-insights-asp-net-troubleshoot-no-data或尝试使用其他机器运行您的应用程序?看起来可能是防火墙问题或类似问题。

于 2018-05-09T19:40:59.443 回答