You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open the project and update the connection-string to your application insights instance (Program.cs)
Run the console app for 5 min on your local machine and wait up until the application shuts down
Query your application insights instance using the below kusto queries:
Query to check if all exceptions are retained:
exceptions
| where timestamp > datetime("<startDateTime>")
| summarize RetainedPercentage = 100/avg(itemCount) by bin(timestamp, 1d), itemType
The RetainedPercentage is < 100%, so exceptions are not retained. See
Query to check the number of exceptions:
exceptions
| where timestamp > datetime("<startDateTime>")
| order by timestamp asc
We expect around 3000 exceptions, but the actual number is lower, so not all exceptions are retained. See
Workaround
You might consider implementing and registering a telemetry initializer to retain exceptions while awaiting a fix.
public class ExceptionTelemetryInitializer : ITelemetryInitializer
{
public void Initialize(ITelemetry telemetry)
{
if (telemetry is not ExceptionTelemetry exceptionTelemetry) return;
ISupportSampling supportSampling = exceptionTelemetry;
supportSampling.SamplingPercentage = 100;
}
}
The text was updated successfully, but these errors were encountered:
nielsruys
changed the title
Configuring "Exception" as an ExcludedTypes in adaptive sampling still results in ExceptionTelemetry being sampled
Configuring "Exception" as ExcludedTypes in adaptive sampling still results in ExceptionTelemetry being sampled
Nov 14, 2024
You are missing the build() statement on the telemetryProcessorChainBuilder. You should also set EnableAdaptiveSampling = false in the AddApplicationInsightsTelemetry call.
*.csproj
file):Describe the bug
Configuring "Exception" as ExcludedTypes in adaptive sampling still results in ExceptionTelemetry being sampled.
To Reproduce
Workaround
You might consider implementing and registering a telemetry initializer to retain exceptions while awaiting a fix.
The text was updated successfully, but these errors were encountered: