cortexproject/cortex-tools

Loki backend for rules check

Closed this issue · 2 comments

There was a backend flag to rules check that allowed passing in Loki as an option. Is there an alternative to it now?

https://github.com/grafana/cortex-tools/blob/1499f5fb286e672cd238a525169d4cb05f964eab/pkg/commands/rules.go#L51

❯ ~/Downloads/cortextool_0.17.0_mac-os_x86_64 rules check alerting/loki/*.yaml
ERRO[0000] unable parse rules file                       error="6:17: group \"pulsar-bigquery\", rule 0, \"ErrorsInLogs\": could not parse expression: 1:68: parse error: unexpected character: '|'" file=alerting/loki/bqloader-alerts.yaml
cortextool_0.17.0_mac-os_x86_64: error: check operation unsuccessful, unable to parse rules files: file read error, try --help

expr in question:

expr: sum(rate({app="pulsar-bigquery", environment=~"prod|stage"} |= `ERROR`[1m])) by (environment, instance, tenant, deploy_region, team, app, org) > 0

I see this #7
Will this never be supported?

Hey @adyanth, I believe Loki is out of the scope of this tool now and they should have their own tool to perform such kind of task. Hence, I am going to close this issue