Let's work with Application Insights - a Microsoft Azure service - to monitor our application endpoint
This is the third article about Health Checks and Application Monitoring.
- Adding Health Check endpoint
- Adding UI Health Check
- Using Application Insights Endpoint Monitoring --> this article
- Using Azure App Services Endpoint Monitoring
This article assumes that you have a Health Checks endpoint up and running available over the internet.
If not go back to this article to set up and them return here.
The Health Check UI is not necessary for this article, only the API endpoint.
Applications Insights it's a great tool for monitoring, error logging, performance monitor, dependency mapping, and other things. In other words, it's a fully APM - Application Performance Management.
Application Insights, a feature of Azure Monitor, is an extensible Application Performance Management (APM) service for developers and DevOps professionals.
According to https://azure.microsoft.com/en-us/pricing/details/monitor/ the ping test is always free.
Our API should be available over the internet (Application Insights should have access to hit it).
I published mine at https://webapphealthchecks.azurewebsites.net/
You can use it for testing purposes if you like.
Creating Application Insights Resource
Access the Azure Portal at https://portal.azure.com and access the Application Insights blade and the click Add to create a new resource.
Enter all the required information to create the resource, such as subscription, resource group, etc.
When asked for the Resource Mode choose the
Once the Application Insights it's created, go to the
This is where the monitoring tool is configured to watch our endpoint.
Now click on the
+Add Test button.
Fill the required information.
- Test name: AI-Ping-WebApp
- Test Type: URL ping test
- URL: https://webapphealthchecks.azurewebsites.net/healthcheck
- Parse dependent requests: unchecked
- Enable retries for availability test failures: checked
- Test frequency: 5 minutes
- Test locations: default values
- Test Timeout: 120 seconds
- HTTP Response: checked
- Status code must equal: 200
- Content match: checked
- Content must contain: Healthy
- Alerts: leave as default
And them Create.
Now just wait for the tests begin and show the results. After a few minutes, you should get something like this.
That is it!
Leave a comment if you have any questions or like it.