Check #

The check component contains tools for validation of Prometheus rules.

Deployment #

Flags #

usage: thanos check <command> [<args> ...]

Linting tools for Thanos

Flags:
  -h, --help               Show context-sensitive help (also try --help-long and
                           --help-man).
      --version            Show application version.
      --log.level=info     Log filtering level.
      --log.format=logfmt  Log format to use.
      --tracing.config-file=<tracing.config-yaml-path>
                           Path to YAML file that contains tracing
                           configuration.
      --tracing.config=<tracing.config-yaml>
                           Alternative to 'tracing.config-file' flag. Tracing
                           configuration in YAML.

Subcommands:
  check rules <rule-files>...
    Check if the rule files are valid or not.

Rules #

check rules checks the Prometheus rules, used by the Thanos rule node, if they are valid. The check should be equivalent for the promtool check rules but that cannot be used because Thanos rule has extended rules file syntax, which includes partial_response_strategy field which promtool does not allow.

If the check fails the command fails with exit code 1, otherwise 0.

Example:

$ ./thanos check rules cmd/thanos/testdata/rules-files/*.yaml
usage: thanos check rules <rule-files>...

Check if the rule files are valid or not.

Flags:
  -h, --help               Show context-sensitive help (also try --help-long and
                           --help-man).
      --version            Show application version.
      --log.level=info     Log filtering level.
      --log.format=logfmt  Log format to use.
      --tracing.config-file=<tracing.config-yaml-path>
                           Path to YAML file that contains tracing
                           configuration.
      --tracing.config=<tracing.config-yaml>
                           Alternative to 'tracing.config-file' flag. Tracing
                           configuration in YAML.

Args:
  <rule-files>  The rule files to check.

Found a typo, inconsistency or missing information in our docs? Help us to improve Thanos documentation by proposing a fix on GitHub here ❤️