I am talking about the services which let you monitor the status of a website whether the website is up and operational or down or under heavy load.
how do they work under the hood?
for example:
I am building something similar for monitoring my web projects.
You should check out Uptime Kuma which offers different monitor types. This should give you a good start for your own implementations. Or maybe you’ll find that Uptime Kuma already covers your usecase.