Validation in CI
A variety of tools exist for testing and validating various aspects of Prometheus’s configuration files. However, the two most simple and direct options are to use the promtool
and amtool
binaries for performing validations related to Prometheus and Alertmanager, respectively. The Prometheus project provides these binaries, which are automatically included in releases downloaded from GitHub for their respective projects.
Each of these tools has multiple subcommands that can be used to test and validate different parts of their related configurations. To begin with, let’s see what we can accomplish using the promtool
CLI application.
Using promtool
The promtool
binary is extremely flexible in a number of things it can do. It’s able to do everything from interacting directly with the TSDB to running pprof
profiles. However, we’re going to focus on what it can do when it comes to validating Prometheus’s configuration and rules...