Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore Endpoints from Azure Application Insights

I have enabled Traffic Manager and the Monitoring Settings on my web role, now my Application Insights usage is completely unusable (11K impressions in a 24 hour period from Internet Explorer or Windows NT) and marks it as "real user traffic"? Smh.

Further injury is the abysmal UX to "filter" route names from the blades especially when I have dozens of endpoints with no way to save. Nor have I found a way to export to .pdf, so that I can share with advisors and/or investors. I can export all of this data to JSON and create my own reports/analytics in an effort to spend time, resources, and money to recreate what's already been created and what I’m already paying for? Does not compute.

Is there a way to set a MVC Attribute/Filter on a particular endpoint or route so that it doesn't participate in any Application Insights server request tracking? Or is that just too easy?

like image 239
System Namespace Avatar asked Oct 20 '22 12:10

System Namespace


1 Answers

If you have a way to differentiate synthetic traffic in code, for example, by looking at headers, you can mark it as such by implementing telemetry initializer, for example:

public class SyntheticSourceInitializer : ITelemetryInitializer
{
    public void Initialize(Microsoft.ApplicationInsights.Channel.ITelemetry telemetry)
    {
        if (MySyntheticCheck(HttpContext.Current.Request))
        {
            telemetry.Context.Operation.SyntheticSource = "MySyntheticSource";
        }
    }
}

See this blog post on how to register telemetry initializer.

Once you have traffic identified as synthetic, you will be able to filter it out.

like image 187
Alex Bulankou Avatar answered Oct 22 '22 01:10

Alex Bulankou