Prometheus is a complex beast. I’ve been using it at work for the past year, and I always felt that I could barely understand what was going on. Picking up this book is a great way to start filling those gaps. Roughly, there are the following sections:
- Application Monitoring
- Infrastructure Monitoring
Whether you are monitoring applications or infrastructure, the core components are the same. Instrumenting the code or using exporters, and then publishing metrics that Prometheus will scrape, with a few labels to sprinkle on top.
There are plenty of components that need to be deployed to have a more complete setup. The node-exporter, the blackbox-exporter, and others make an appearance. This is more relevant as an operator, however.
I set up a simple installation of Prometheus to try things more practically. It’s in this repository and can be run with Docker.
The toughest part of the book is the comprehensive overview of PromQL, Prometheus’s query language. If you want to write queries that make any sense, this section is a must-read. Otherwise, you’ll find yourself trying different combinations of
rate, and whatnot until your queries somehow work.
Alerting is especially relevant if you handle on-call for a system. From experience, a misconfigured alerting setup can cause a lot of friction and pain, so it’s good to invest in understanding which kind of alerts you can get, and when.
Visualizing your metrics is a big part of monitoring, which in this ecosystem is handled by grafana. Grafana is another complex beast. You’ll find about twenty pages on the topic, which is not nearly enough to get a deep understanding of how to build all those fancy dashboards that you see out there. But it’s an interesting appetizer to get started.
Prometheus has been around for a while, all in all. It seems to be the standard monitoring collecting tool these days. Knowing about it is a good investment of your time, and I think this book strikes a reasonable balance of being practical and giving you deeper insights, thus getting ⭐⭐⭐⭐ stars.
Originally published at https://hceris.com on January 8, 2021.