HN user

TwinProduction

52 karma
Posts4
Comments15
View on HN

Hahaha this article is a lot more meta than I thought it would be on a Thanksgiving morning.

Great article nometheless; it seems like we just got really, really lucky.

Any company large enough _will_ have to deal with compliance at some point, that's why most devs in large software companies have to take these silly "exams" every year telling you to not plug a USB key you found on the floor in your company laptop, even if it should be very obvious to most.

I'm seeing a lot of people here that are surprised by the fact that even a company who has privacy as their main marketing point has to deal with compliance, but really, unless you host your own mail server, you just can't guarantee your own privacy.

I don't generally advise hosting your own mail server due to all the troubles that come with it, but this is really one of the only ways I can think of where you can achieve a decent enough level of control when it comes to exchanging emails.

Ah, the range that you're seeing on the top right corner of each service is the minimum and maximum response time.

The time on the bottom left is how long ago the oldest status is, while the one on the right is how long ago the latest status is from.

Who knows, maybe in the next version, you'll be able to link up your heart rate monitor.

(I'm joking, of course, unless this somehow becomes a serious use case at some point xD)

I honestly didn't even know that was a thing. That said, it looks like it doesn't support JSONPath out of the box, though I was able to find a plugin that should allow you to parse JSON. I'm not sure how that would work out, but the point is that this is all-in-one.

Beyond just that, the resource usage of Gatus is significantly lower than running Grafana, Prometheus and alertmanager individually - much less running all of them at the same time.

My personal Kubernetes cluster is quite limited in resources after all, and running Prometheus does make that resource pool even smaller than it already is :p

That said, even for clusters that don't have similar resource restrictions, I find that having all of this together in a single application makes it a lot easier to manage, though I guess that's up to the individual :)

While Grafana allows you to monitor metrics provided by Prometheus and Alertmanager allows you to configure alerts also based on these metrics, Gatus allows you to directly monitor your service(s) by sending requests to them at interval and evaluating the conditions that make your service(s) "healthy".

As mentioned in the README, Gatus can double as automated user acceptance tests to check if, for instance, an endpoint that you expect to return X has Y instead.

Let me know if that's not clear enough, I can provide more a in-depth example :)

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.

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's healthy.

After implementing that, however, I felt that it was bit too lacking. Sure, it could've helped roughly determining the availability of a service, but it wasn't able to make the difference between "everything is ok" and "everything is not ok".

For instance, let'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's no content, so is it really accurate to call the service "healthy"?

That'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'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.

For the example I mentioned earlier, the solution would simply be to add the following condition to the service configuration: `len([BODY].recipes) > 0`. This condition would make sure that the response body has the field `recipes` and it has a length of at least 1.

I wrote a short article on my website, if you want a bit more context: https://twinnation.org/articles/46/gatus-automated-health-da...

Any feedback is greatly appreciated :)