mimir icon indicating copy to clipboard operation
mimir copied to clipboard

linter not fully support loki rule syntax

Open timansky opened this issue 3 years ago • 1 comments
trafficstars

Describe the bug

mimirtool lint not fully support loki rule syntax

To Reproduce

$ cat loki_rule.yml

groups:
  - name: loki_records
    rules:
      - record: rate1m
        expr: |
          sum (
            rate( {app="foo"} | json | __error__="" [1m] )
          )

stdout:

$ mimirtool rules lint -n --rule-files=loki_rule.yml
ERRO[0000] unable parse rules file                       error="5:15: group \"loki_records\", rule 0, \"rate1m\": could not parse expression: 2:21: parse error: unexpected character: '|'" file=loki_rule.yml
mimirtool: error: prepare operation unsuccessful, unable to parse rules files: file read error, try --help

timansky avatar Aug 16 '22 05:08 timansky

mimirtool currently doesn't support Loki. Loki users should use https://github.com/grafana/cortex-tools instead.

pracucci avatar Aug 16 '22 06:08 pracucci

Any plans for mimirtool to support loki ?

ramukima avatar Sep 30 '22 17:09 ramukima

Any plans for mimirtool to support loki ?

Not in mimirtool, no. Loki team is evaluating creating a dedicated tool but that's something they'll have to prioritize (or not).

56quarters avatar Sep 30 '22 17:09 56quarters