如何使用 Application Insights 禁用 Azure Functions 采样

问题描述 投票:0回答:0

我想禁用对使用应用程序洞察力的 Azure 函数的采样。我已经遵循了这些文档,但仍然启用了采样。

Application Insights 中的抽样

如何为 Azure Functions 配置监控

在 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);
azure azure-functions azure-application-insights
© www.soinside.com 2019 - 2024. All rights reserved.