Skip to content

GiedriusS/pint

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pint

pint is a Prometheus rule linter.

Usage

There are two modes it works in:

  • CI PR linting
  • Ad-hoc linting of a selected files or directories

Pull Requests

It currently supports git for which it will find all commits on the current branch that are not present in parent branch and scan all modified files included in those changes.

Results can optionally be reported using BitBucket API to generate a report with any found issues. Each issue will create an inline annotation in BitBucket with a description of the issue. Exit code will always be zero when this is used, the report itself will indicate if checks passed or not.

Ad-hoc

Lint specified files and report any found issue.

You can lint selected files:

pint lint rules.yml

or directories:

pint lint path/to/dir

or both:

pint lint path/to/dir file.yml path/file.yml path/dir

Quick start

Requirements:

  1. Build the binary:

    git clone https://github.com/cloudflare/pint.git
    cd pint
    make build
  2. Run a simple syntax check on Prometheus alerting or recording rules file(s).

    ./pint lint /etc/prometheus/*.rules.yml
  3. Configuration file is optional, but without it pint will only run very basic syntax checks. See CONFIGURATION.md for details on config syntax. Check examples dir for sample config files. By default pint will try to load configuration from .pint.hcl, you can specify a different path using --config flag:

    ./pint --config /etc/pint.hcl lint /etc/prometheus/rules/*.yml

About

Prometheus rule linter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.4%
  • Other 0.6%