You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何禁用使用Application Insights的Azure Function的采样功能?

问题:Azure Function中禁用Application Insights采样功能无效

已参考官方文档尝试禁用Azure Function的Application Insights采样功能,但采样仍处于启用状态。

用于确认采样率的Application Insights查询:

dependencies
| where timestamp > ago(1d)
| summarize RetainedPercentage = 100/avg(itemCount) by bin(timestamp, 1h)
| order by timestamp desc

当前使用的host.json配置:

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "LogLevel": {
        "default": "Information"
      },
      "samplingSettings": {
        "isEnabled": false
      }
    }
  }
}

同时尝试通过代码禁用采样:

var aiOptions = new ApplicationInsightsServiceOptions
            {
                EnableAdaptiveSampling = false,
                InstrumentationKey = configuration.GetValue<string>("Telemetry:AppInsightsInstrumentationKey")
            };
            services.AddApplicationInsightsTelemetry(aiOptions);

内容的提问来源于stack exchange,提问作者matthewscott

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.21 17:29:58