首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >关闭应用程序洞察力的抽样

关闭应用程序洞察力的抽样
EN

Stack Overflow用户
提问于 2018-03-19 13:22:48
回答 1查看 6.6K关注 0票数 2

我正在使用一个web应用程序和最新版本的visual 2015应用程序洞察力,我试图关闭应用程序洞察力的抽样,但它仍然在继续,我删除了以下内容:

代码语言:javascript
运行
复制
<Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
  <MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond>
  <IncludedTypes>Event</IncludedTypes>
</Add>

我添加了以下内容

代码语言:javascript
运行
复制
   <Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
  <MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond>
  <ExcludedTypes>Event;PageView;Request</ExcludedTypes>
</Add>

我甚至尝试删除ExcludedTypes的所有部分,我也尝试了下面的内容

代码语言:javascript
运行
复制
   <Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
  <ExcludedTypes>Event;PageView;Request</ExcludedTypes>
</Add>

但是所有这些都不起作用,我一直得到下面的信息

EN

回答 1

Stack Overflow用户

发布于 2018-03-20 05:45:01

正如ZakiMa所说,您可以尝试删除或注释掉AdaptiveSamplingTelemetryProcessor节点。请参阅此文章

禁用自适应采样:在ApplicationInsights.config中,删除或注释掉AdaptiveSamplingTelemetryProcessor节点。

代码语言:javascript
运行
复制
<TelemetryProcessors>

<!-- Disabled adaptive sampling:
  <Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
    <MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond>
  </Add>
-->

如果您的项目是.Net核心项目,则可以通过代码禁用自适应抽样。请参阅此文章

代码语言:javascript
运行
复制
 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);                        
        }
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49364060

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档