Skip to content
Pre commit checks for prometheus config and rule files
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.pre-commit-config.yaml Removing script language checks and moving to docker_image Mar 18, 2019
.pre-commit-hooks.yaml
CONTRIBUTING.md
LICENSE
README.md

README.md

pre-commit-prometheus

Pre commit checks for valid syntax of prometheus config and rule files

This is a plugin for pre-commit

Usage

To lint Prometheus Rules files, use the prometheus-rules hook. Make sure to filter files passed to hook by defining the files section. Note: the entry option below is optional and will default to the latest prometheus version. It is shown just as an example of pinning to a specific prometheus version.

- repo: https://github.com/fortman/pre-commit-prometheus
  rev: v1.1.1
  hooks:
  - id: check-rules
    entry: --entrypoint /bin/promtool prom/prometheus:v2.6.0
    files: >
      (?x)^(
        rules_directory/.*\.yml
      )$

To lint Prometheus Config files, use the prometheus-config hook. Make sure to filter files passed to hook by defining the files section. Note: the entry option below is optional and will default to the latest prometheus version. It is shown just as an example of pinning to a specific prometheus version.

- repo: https://github.com/fortman/pre-commit-prometheus
  rev: v1.1.1
  hooks:
  - id: check-config
    entry: --entrypoint /bin/promtool prom/prometheus:v2.6.0
    files: >
      (?x)^(
        config_directory/.*\.yml
      )$
You can’t perform that action at this time.