Sending availability alert based on response content in Application Insights

Sending availability alert based on response content in Application Insights

With Application Insights you can also test the web availability by adding  Web Test with your hosted applications. Application Insights sends the request to the hosted services endpoint in a regular intervals  and sends alerts based on the criteria specified for it.

While configuring the Web Test, we can setup the Success Criteria by specifying the HTTP Response Code.  By default the Status Code is set to 200,and you can change it as per your need.

Must Read : Using Application Insights right from the Visual Studio 2015

Once the Success Criteria is satisfied Application Insight will send the alert based on pre configured destination.

image

So what is all about sending alerts based on Content ? Well, couple of days back I was having discussion with one of my buddy, where he was looking for the web test alert, but not only with the Status Code, but also with the response content message. Because, he was expecting some different response text even if the Status Code is same and for a specific response text he wants the alert to be triggered.

Related Post : Save and share your Application Insights results for quick access

Application Insight does support that to. In the Web Test Configuration section,  along with the response code  there is a  Content match check box. This can be used along with the HTTP Response code or can be used alone. Once you select the Content match check box, you have to provide the “Content must contain” text in the give text box.

image

When both the “Http Response’’” and “Content Match” is selected it will validate both the condition before raising the alert. Incase of only “Content Match” is selected it will ignore the Http Response Status Code and trigger the alert when content is matched.

You can read more about web Availability over here Monitor availability and responsiveness of any web site

Hope this helps !

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

7 Comments to “Sending availability alert based on response content in Application Insights”

Comments are closed.