Posts

Getting Location and Weather from an IP Address

This was ported from my original blog post here . Introduction The concept of getting the location for a given IP address is not exactly new, and some posts have been written about it already. Still, I wanted to write about it because I will need it for a later article, and, to add something, also explain how to get the weather forecast for the given location. Let's start by getting the location for a given IP address. Geo Location There are plenty of services available for free or a fee on the Internet that will give you some information about the location of an IP address (geo location by IP). To name just a few, in no particular order: https://www.iplocation.net https://hackertarget.com/geoip-ip-location-lookup https://ip-api.com https://ipapi.co https://freeipapi.com https://ipgeolocation.io Some of these offer free services (with possibly some limitations, such as rate limiting per hour/day) where others offer full working sets. Also, the amount of information varies, al...

Checking the Health of an ASP.NET Core Application

Image
This was ported from my original blog post here . Introduction Having a way to evaluate the health status of our system has been around since  ASP.NET Core 2.2 . In a nutshell, the idea is, you register a number of health checks, and you run them all at some time to assess their state, if any of them returned anything other than healthy, then the system is considered to be either unhealthy or degraded. Health Checkers A health checker is an implementation of  IHealthCheck  registered with a unique name and possibly some associated tags. Microsoft makes available a few checkers, in packages  Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization  (for system resources, CPU and memory usage),  Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore  (for EF Core), and  Microsoft.Extensions.Diagnostics.HealthChecks.Common ,  Microsoft.Extensions.Diagnostics.Probes  (for  Kubernetes ), as well as a framework t...