我正在使用一个web应用程序和最新版本的visual 2015应用程序洞察力,我试图关闭应用程序洞察力的抽样,但它仍然在继续,我删除了以下内容:
<Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
<MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond>
<IncludedTypes>Event</IncludedTypes>
</Add>
我添加了以下内容
<Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
<MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond>
<ExcludedTypes>Event;PageView;Request</ExcludedTypes>
</Add>
我甚至尝试删除ExcludedTypes
的所有部分,我也尝试了下面的内容
<Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
<ExcludedTypes>Event;PageView;Request</ExcludedTypes>
</Add>
但是所有这些都不起作用,我一直得到下面的信息
发布于 2018-03-20 05:45:01
正如ZakiMa所说,您可以尝试删除或注释掉AdaptiveSamplingTelemetryProcessor节点。请参阅此文章。
禁用自适应采样:在ApplicationInsights.config中,删除或注释掉AdaptiveSamplingTelemetryProcessor节点。
<TelemetryProcessors>
<!-- Disabled adaptive sampling:
<Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
<MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond>
</Add>
-->
如果您的项目是.Net核心项目,则可以通过代码禁用自适应抽样。请参阅此文章。
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
var tc = TelemetryConfiguration.Active;
var channel = tc.TelemetryChannel;
var aiOptions = new Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions();
aiOptions.EnableAdaptiveSampling = false;
aiOptions.InstrumentationKey = "myikey";
services.AddApplicationInsightsTelemetry(aiOptions);
}
https://stackoverflow.com/questions/49364060
复制相似问题