'Does setting fixed rate sampling of an Application Insights Telemetry item affect child telemetry items
We have a particular application insights dependency that we do not want sampled. I have set the sampling percentage to 100 percent for this dependency only using an ITelemetryInitializer class, as shown below:
public void Initialize(ITelemetry telemetry)
{
if (telemetry is not DependencyTelemetry supportedTelemetry)
return;
//turn sampling off for this dependency only
if (supportedTelemetry.Name == "MyParentDependency")
((ISupportSampling)telemetry).SamplingPercentage = 100;
}
Thousands of other dependencies are in the scope of this dependency (eg, same operation id). My concern is that the fixed sampling will apply to the child dependencies. I want the adaptive sampling to still apply to the child dependencies, otherwise our billing will be astronomical. My understanding is the adaptive sampling has a target rate of 5 telemetry items per second, but when I am testing, I see well over 5 dependencies per second over a long period of time, and I don't see any sampling applied to the child dependencies. It seems like everything is getting a sampling rate of 100 percent. Is setting the parent dependency to 100 percent causing the child dependencies to be sampled at the same rate? Is there a way to change this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
