Linting Prometheus rules with Pint
Pint is the secret sauce we’ve been missing all along. Honestly, if you add linting via the pint
command to your CI pipelines, you can probably just skip most of the promtool
validation for rules. But what is it? A unit of liquid measurement? Yes, and more!
Pint is a delightful tool to come out of Cloudflare, where they run Prometheus deployments at a tremendous scale (see the blog posts linked at the end of the chapter). In order to accommodate this scale, the team responsible for managing these hundreds of Prometheus instances needs to avoid being a bottleneck for other teams needing to manage their recording and alerting rules on these servers. In order to ensure that their rules are safe, valid, and will work as intended, they created Pint.
The core feature of Pint that distinguishes it from something such as promtool
is that it connects to one or more active Prometheus instances to confirm that rules will work as expected. It does...