I'd like to switch to using Application Insights for logging etc. I know I'm going to need to use sampling on my telemetry data, to stay within the free plan. However, I want to be able to see all event sequences that led to an exception being thrown, so I can reproduce them.
Does Application Insights come with something like this built in? And if not, is there some way I can write a custom sampler which produces the desired behaviour? E.g.
class CustomSampler : ITelemetrySampler
There is the ExcludeTypes property in version 2.2.0 of the AdaptiveSamplingTelemetryProcessor.
<Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
<MaxTelemetryItemsPerSecond>499</MaxTelemetryItemsPerSecond>
<ExcludedTypes>Exception</ExcludedTypes>
</Add>
From the release notes of 2.2.0-beta1
Telemetry types can be excluded from sampling by specifying the ExcludedTypes property (Add ExcludedTypes element under AdaptiveSampling telemetry processor node with ';'-separated list. Possible types are "Dependency", "Event", "Exception", "PageView", "Request", "Trace").
https://github.com/Microsoft/ApplicationInsights-dotnet/blob/v2.2.0/src/TelemetryChannels/ServerTelemetryChannel/Shared/AdaptiveSamplingTelemetryProcessor.cs#L67
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With