I'm developing a Blazor WebAssembly app and I would like to see logs in Application Insights instance from it. To avoid unecessary amount of events, I have set Data Sampling to 50% on the AI instance.Nevertheless, there are certain events that I want to track always and I'm trying to figure out how to enforce sample rate to be 100% for this.Based on my research I did write a custom telemetryInitializer:
appInsights.addTelemetryInitializer((envelope) => { envelope.sampleRate = 100;});The code above should turn all the trace events to 100 to my knowledge - but it doesn't.
I understand this could be misused by manipulating the JavaScript, but I'm curious if it can be achieved or not. I kind of run out of all my ideas.Has anyone tried it and succeeded?