TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Gatus – Automated Service Health Dashboard Written in Go

7 pointsby TwinProductionalmost 5 years ago

1 comment

TwinProductionalmost 5 years ago
Gatus is a project that I started because I wanted to have an automated service health dashboard, and I wanted it to be as low maintenance as possible.<p>Originally, determining whether a service was healthy or not was going to be very simple: is the status 5xx? If yes, the service is unhealthy, otherwise, it&#x27;s healthy.<p>After implementing that, however, I felt that it was bit too lacking. Sure, it could&#x27;ve helped roughly determining the availability of a service, but it wasn&#x27;t able to make the difference between &quot;everything is ok&quot; and &quot;everything is not ok&quot;.<p>For instance, let&#x27;s say you want to test an endpoint that should return a list of recipes, and for whatever reason, the endpoint starts returning an empty list of recipes. The endpoint would still return a 200, but there&#x27;s no content, so is it really accurate to call the service &quot;healthy&quot;?<p>That&#x27;s why I implemented a way to supply conditions that Gatus will evaluate in order to determine whether a service is healthy or not. These conditions range from status code to body comparison with the help of a JSONPath-like syntax. I also extended that by adding the ability to resolve the length of the value of said JSON path, which allows even greater flexibility for when you don&#x27;t know exactly what the data is (or the data is bound to change), but you know that this data should exist, or a certain number of elements should be returned.<p>For the example I mentioned earlier, the solution would simply be to add the following condition to the service configuration: `len([BODY].recipes) &gt; 0`. This condition would make sure that the response body has the field `recipes` and it has a length of at least 1.<p>I wrote a short article on my website, if you want a bit more context: <a href="https:&#x2F;&#x2F;twinnation.org&#x2F;articles&#x2F;46&#x2F;gatus-automated-health-dashboard-with-alerting" rel="nofollow">https:&#x2F;&#x2F;twinnation.org&#x2F;articles&#x2F;46&#x2F;gatus-automated-health-da...</a><p>Any feedback is greatly appreciated :)