Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not parse expression: parse error at char 107: range specification must be preceded by a metric selector #9

Open
endejoli opened this issue Oct 11, 2020 · 1 comment

Comments

@endejoli
Copy link

Rule file which is working fine without using the prom-rule-reloader throws below error while loading through prom-rule-reloader. Is there a way to turn off the rule test ?

E1011 13:14:58.931662 1 main.go:197] Skipping invalid rule file: am-wmeshbto-rxcdqvjp-pnlsnuvn/prometheus-alert-rules-config/pod.rules: [group "PodAlerts", rule 0, "PodNotHealthy": could not parse expression: parse error at char 107: range specification must be preceded by a metric selector, but follows a *promql.AggregateExpr instead]

Here is the rule I am using

groups:
- name: PodAlerts
rules:
- alert: PodNotHealthy
expr: min_over_time(sum by(kubernetes_namespace, kubernetes_pod_name, app, name) (aspnetcore_healthcheck_status)[15m:]) < 1
for: 5m
labels:
severity: high
annotations:
summary: "{{ $labels.name }} in pod {{ $labels.kubernetes_pod_name }} failed"
description: "{{ $labels.name }} for pod {{ $labels.kubernetes_pod_name }} in namespace {{ $labels.kubernetes_namespace }} has been unhealthy for longer than 15m."

@mthssdrbrg
Copy link

Hi!

There isn't currently any way of turning off the testing of rules / alerts. The reason you're seeing this is because the version of Prometheus dependencies that the prom-rule-reloader is currently using doesn't support subqueries (https://prometheus.io/blog/2019/01/28/subquery-support/).

I suppose adding a flag to disabling would be one way to get around it, but the proper solution would be to update the dependencies so that support for subqueries is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants