promqlinter

module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2022 License: MIT

README

promqlinter

A PromQL parser/type-checker/linter in GitHub Actions/CLI

img1.png

Features

GitHub Actions

See Using promqlinter in GitHub Actions.

CLI

$ ./bin/promqlinter -h
A PromQL linter with CLI/GitHub Actions

Usage:
  promqlinter [flags]

Examples:

        # lint a raw PromQL expression that is given from stdin
        echo -n 'http_requests_total{job="prometheus"}' | promqlinter

        # lint a raw PromQL expression in the PrometheusRule manifest
        promqlinter -i ./examples/manifests/sample.yaml

        # lint each raw PromQL expression in the PrometheusRule manifests in ./manifest
        promqlinter -r -i ./examples/manifests/

        # configure denied-label plugin
        # e.g., this example denies <vector{job="node_exporter", instance=".*"}
        promqlinter -r -i ./examples/manifests/ --denied-labels "job %PAIR% node_exporter,instance %PAIR% .*"

Flags:
  -d, --denied-labels string        the denied labels
  -h, --help                        help for promqlinter
  -i, --input-k8s-manifest string   the target PrometheusRule resource
  -f, --level-filter string         the diagnostic level filter(info/warning/error) (default "error")
  -r, --recursive                   determine whether the manifest search process should be recursive

Directories

Path Synopsis
cmd
promqlinter
MIT License
MIT License
examples
internal
cli
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL