Blogginlägg

Introducing Orneholm.ApplicationInsights.HealthChecks! - ASP.NET Core Health Checks publisher for Application Insights

Av Peter Örneholm | Blogg | 11 januari 2019

ASP.NET Core Health Checks is a great feature introduced in ASP.NET Core 2.2. It allows you to define a set of health checks that can verify the health status of your application by checking a range of conditions, like access to a database, Azure storage or maybe an external SMTP server.

The most common scenario is to publish and endpoint that hints the health of the application so that external monitoring solutions can check it, like a Kubernetes Cluster, Azure Traffic Manager or Application Insights Availability tests.

Speaking about Application Insights Availability, that is a great service that can ping your web application from locations around the globe to verify it is available. But even with the health check monitor endpoint enabled, you still would not get the exact details on what wasn’t working in case it reports unhealthy. Likewise, if the application is behind a firewall, no external service would be able to ping it. That leads us into…

image

Orneholm.ApplicationInsights.HealthChecks uses the IHealthCheckPublisher API:s to periodically push the health check reports, including details, to Application Insights as Availability telemetry.

Now you can track the health in Azure Portal:

image

You can also get full details by querying the data in Analytics:

image

And plot those durations as a scatter chart to get a visual overview:


The package is now available on NuGet:
https://www.nuget.org/packages/Orneholm.ApplicationInsights.HealthChecks/

All source code is published under the MIT-license at GitHub:
https://github.com/PeterOrneholm/Orneholm.ApplicationInsights

If you have feedback or question, please file an Issue at GitHub or ping me at Twitter! Enjoy!

Till inlägget