如何禁用使用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
相关产品推荐
相关产品推荐

