Reputation: 161
I have a web app in Azure for which I've turned on Application Insights. In my app I use the Progress/Telerik Kendo for JavaScript API, version 2017.3.1102 which is bundled with jQuery 1.12.3.
Application Insights is logging handled exceptions from jQuery, exceptions which are documented here as purposeful: https://bugs.jquery.com/ticket/14123
I'd like to stop these from being logged by AI. I'm trying to troubleshoot an obscure security token issue so I want logging to be expansive, but these handled exceptions are generating thousands of entries per hour in my Application Insights logs.
Is there a way to exclude specific JavaScript files or APIs or 'handled' exceptions from being logged?
Upvotes: 0
Views: 1382
Reputation: 36
If you choose to go the TelemetryProcessor route you can implement your telemetry processor which would examine the event and filter out unwanted events. Returning false from the telemetry processor when a condition is met would filter out the event.
Thanks Ivan for linking the ITelemetryProcessor documentation. I realized that the documentation doesn't have details on how to implement filtering in JavaScript. Will update it now.
Here is a sample showing how one could implement filtering:
var filteringFunction = (envelope) => {
if (envelope.data.someField == "tobefilteredout") {
return false;
}
return true;
};
appInsights.addTelemetryInitializer(filteringFunction);
Upvotes: 2