Git Product home page Git Product logo

Comments (9)

sed-i avatar sed-i commented on September 23, 2024 1

Any rules without equality matchers should do. I think I was using this one:

alert: CPUOverUse
expr: process_cpu_seconds_total > 0.12
for: 0m
labels:
  severity: Low
annotations:
  summary: "Instance {{ $labels.instance }} CPU over use"
  description: "{{ $labels.instance }} of job {{ $labels.job }} has used too much CPU."

from loki-k8s-operator.

sed-i avatar sed-i commented on September 23, 2024

@rbarry82 do you mind submitting that / to _ replacement fix?
ok I see it's just because loki wasn't pushed yet since the fix

Revision    Version    Created at    Status
13          13         2022-01-28    released

from loki-k8s-operator.

rbarry82 avatar rbarry82 commented on September 23, 2024

@dstathis Probably should be pushed to avoid the path nested from units

from loki-k8s-operator.

Abuelodelanada avatar Abuelodelanada commented on September 23, 2024

Hi @sed-i

When I replaced the rule with the following, Loki was happy

groups:
 - name: example
   rules:
     - alert: HighThroughputLogStreams
       expr: absent_over_time({namespace="dev",job=~".*-logs"}[2m])
       for: 2m

Do you have a previous alert rule example that fails?

from loki-k8s-operator.

Abuelodelanada avatar Abuelodelanada commented on September 23, 2024

Any rules without equality matchers should do. I think I was using this one:

alert: CPUOverUse
expr: process_cpu_seconds_total > 0.12
for: 0m
labels:
  severity: Low
annotations:
  summary: "Instance {{ $labels.instance }} CPU over use"
  description: "{{ $labels.instance }} of job {{ $labels.job }} has used too much CPU."

If the expression is: expr: process_cpu_seconds_total >= 0.12 or expr: process_cpu_seconds_total = 0.12 I get the same error... Seems it is not only the equality matcher... I'm asking in #Loki slack channel to understand if it's a Loki bug.

from loki-k8s-operator.

rbarry82 avatar rbarry82 commented on September 23, 2024

I guess the obvious answer for us is to use the cortex/prometheus validator.

from loki-k8s-operator.

Abuelodelanada avatar Abuelodelanada commented on September 23, 2024

I guess the obvious answer for us is to use the cortex/prometheus validator.

I think we have something interesting: https://github.com/grafana/cortex-tools#rules-lint

from loki-k8s-operator.

mmanciop avatar mmanciop commented on September 23, 2024

From the docs:

The linter's aim is not to verify correctness

from loki-k8s-operator.

Abuelodelanada avatar Abuelodelanada commented on September 23, 2024

The linter's aim is not to verify correctness but just YAML and PromQL expression formatting within the rule file.

We do not want to check the correctness of the expression in terms of it is going to retrieve valid/relevant data. We want to check if it is syntactically valid. Anyway we need to check it,

This issue started because the was no "=" in the expression.

from loki-k8s-operator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.