rules: namespace: monitoring additionalGroups: - name: dlroverrules rules: - record:…
- User
rules: namespace: monitoring additionalGroups: - name: dlrover_rules rules: - record: job:loki_request_duration_seconds_bucket:sum_rate expr: sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, job) - record: job:eee:avg_over_time expr: avg_over_time({atom_job=~".+"} | regexp ".error (?P[0-9.]+)." | unwrap speed [1m])
is this a valid promethesrule?
- Assistant
The YAML snippet you've provided appears to be a Prometheus recording rule configuration. It looks mostly valid, but there are a few things to check for completeness and correctness:
-
Namespace: Ensure that the Prometheus server is configured to use or recognize the namespace if it's part of a Kubernetes setup. The namespace will not affect the rule's correctness but is important for organization.
-
- User
STDERR: Error: admission webhook "prometheusrulemutate.monitoring.coreos.com" denied the request: Rules are not valid
- Assistant
- User
STDERR: Error: admission webhook "prometheusrulemutate.monitoring.coreos.com" denied the request: Rules are not valid
- Assistant
The error from the admission webhook indicates that the Prometheus rules you provided are not accepted due to a validation error. This rejection usually pertains to syntax or compliance issues with the expected PrometheusRule schema. Here are steps to troubleshoot and correct the rules: