3

I have a web application monitored with Application Insights but in the errors view I see non 500 http status responses being registered as errors. Is there a way to tell insights to only register 500 status codes or ignore 400 status codes from the captured events?

1 Answer 1

5

Yes, there is a way. What you can do is register a custom Telemetry Initializer and do something like this:

 public void Initialize(Microsoft.ApplicationInsights.Channel.ITelemetry telemetry)
 {
            if (telemetry is RequestTelemetry && ((RequestTelemetry)telemetry).ResponseCode == "400")
            {
               ((RequestTelemetry)telemetry).Success = true;
            }
 }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.