I have a DotNet 6 application ASP.NET Web API application that is running as an App Service in Azure.
I do not have fixed sampling enabled. I also do not have applicationinsights.json file in my application.
I have code to disable Adaptive Sampling in the ConfigureServices method. The code snippet is below:
if (!string.IsNullOrEmpty(configuration["ApplicationInsights:InstrumentationKey"]))
{
services.AddApplicationInsightsTelemetry(options =>
{
if (webHostEnvironment.IsDevelopment())
{
options.DeveloperMode = true;
options.EnableDebugLogger = false;
}
options.EnableAdaptiveSampling = false;
options.InstrumentationKey = configuration["ApplicationInsights:InstrumentationKey"];
});
services.AddApplicationInsightsTelemetryProcessor<FilterProcessor>();
services.AddSingleton<ITelemetryInitializer, NopContextInitializer>();
}
My Azure settings for application insights is as follows for ingestion sampling
I continue to see sampling happening when I run the below query:
union requests,dependencies,pageViews,browserTimings,exceptions,traces
| where timestamp > ago(1d)
| summarize RetainedPercentage = 100/avg(itemCount) by bin(timestamp, 1h), itemType
My application was a .NET Core 3.1 a few weeks back and could not get sampling to be turned off. Even after upgrading to DotNet 6, I am not able to turn off sampling.
Any pointers on why this may be happening ?