Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Application Insights JS Client-Side: Change Sample Rate for certain events

$
0
0

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?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>