My site performs a status ping every 3 seconds, and it is cluttering up our Application Insights and costing a pretty penny. We are going to switch it over to SignalR eventually, but for now I would like to disable telemetry for this single call.
Is there a way to disable App Insights from reporting the telemetry of this status call from the browser? Or can we disable ingestion telemetry to drop this specific function?
The Browser is performing the ping based off a simple timeout:
setTimeout(function () { updateStatus(30, 3000); }, 3000);
The Resulting logs look like: Logs from App Insights showing repetitive Ping Behavior
You can use a telemetry intializer. When the initializer method returns false
the telemetry item is ignored. An example:
var telemetryInitializer = (envelope) => {
var data = envelope.data.baseData;
if (data.url && data.url.includes("/Status")) {
return false;
}
return true;
};
appInsights.addTelemetryInitializer(telemetryInitializer);