← 返回命令列表

Linux command

pint 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Lint Prometheus rules

pint lint [rules.yaml]

Check rules against live Prometheus

pint -c [config.yaml] lint [rules.yaml]

Watch for changes

pint watch [rules/]

Show rule problems

pint lint --output=json [rules.yaml]

CI mode

pint ci

List available checks

pint checks

说明

pint validates Prometheus alerting and recording rules, catching errors before deployment. It goes beyond basic syntax checking by querying a live Prometheus server to verify that referenced metrics actually exist and that selectors return data. Key capabilities include: PromQL syntax validation, series existence checks against live Prometheus, alert template validation (annotation and label rendering), duplicate rule detection, and cost estimation for expensive queries. The ci mode is designed for pull request workflows — it only reports problems in changed files, making it practical for large rule repositories. The watch mode continuously monitors rule files and re-checks on changes.

参数

lint
Check rules for problems.
watch
Watch and lint continuously.
ci
CI/CD mode.
checks
List available checks.
-c, --config _FILE_
Configuration file.
--output _FORMAT_
Output format.
--no-color
Disable colors.
-v, --verbose
Verbose output.

FAQ

What is the pint command used for?

pint validates Prometheus alerting and recording rules, catching errors before deployment. It goes beyond basic syntax checking by querying a live Prometheus server to verify that referenced metrics actually exist and that selectors return data. Key capabilities include: PromQL syntax validation, series existence checks against live Prometheus, alert template validation (annotation and label rendering), duplicate rule detection, and cost estimation for expensive queries. The ci mode is designed for pull request workflows — it only reports problems in changed files, making it practical for large rule repositories. The watch mode continuously monitors rule files and re-checks on changes.

How do I run a basic pint example?

Run `pint lint [rules.yaml]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does lint do in pint?

Check rules for problems.