Giter Club home page Giter Club logo

Comments (5)

slok avatar slok commented on July 21, 2024

Hi @Eddie4Frost!

In order to help you, I need more context :D

  • Sloth logs.
  • SLO.
  • Are the metrics on the prometheus.
  • The generated rules are loaded on Prometheus.
  • ...

from sloth.

Eddie4Frost avatar Eddie4Frost commented on July 21, 2024

Hi @slok, my bad! Thank you for your response, below:
The metrics available on Prometheus:
image
The sloth log:
INFO[0000] SLI plugins loaded plugins=0 svc=storage.FileSLIPlugin version=v0.9.0 window=30d INFO[0000] SLO period windows loaded svc=alert.WindowsRepo version=v0.9.0 window=30d windows=2 INFO[0000] Loading Kubernetes configuration... version=v0.9.0 INFO[0000] Kubernetes controller running version=v0.9.0 window=30d INFO[0000] starting controller controller-id=sloth lib=kooper service=kooper.controller version=v0.9.0 window=30d INFO[0000] Hot-reload http server listening addr=":8082" version=v0.9.0 window=30d INFO[0000] Metrics http server listening addr=":8081" version=v0.9.0 window=30d INFO[0000] OS signals listener started version=v0.9.0 window=30d INFO[0000] Hot-reload manager running version=v0.9.0 window=30d INFO[0001] Hot-reload triggered from http webhook version=v0.9.0 window=30d INFO[0001] SLI plugins loaded plugins=15 svc=storage.FileSLIPlugin version=v0.9.0 window=30d

The rule:
image

Grafana Query Inspector query:
Object request:Object url:"api/datasources/proxy/1/api/v1/query_range" method:"POST" data:Object query:"1-( sum_over_time( ( slo:sli_error:ratio_rate1h{sloth_service="myservice",sloth_slo="requests-availability"} * on() group_left() ( month() == bool vector(12) ) )[32d:1h] ) / on(sloth_id) ( slo:error_budget:ratio{sloth_service="myservice",sloth_slo="requests-availability"} *on() group_left() (24 * days_in_month()) ) )" start:1638327600 end:1641006000 step:3600 hideFromInspector:false response:Object status:"**success**" data:Object resultType:"matrix" result:Array[0]

Thank you

from sloth.

slok avatar slok commented on July 21, 2024

Do other SLOs work for you, or happen on all of them?. Maye it's just that you aren't burning anything (rare, but who knows...) so there's nothing to chart. To test, you can use the "fake" plugin to simulate different burn rates (this should show you something always):

---
apiVersion: sloth.slok.dev/v1
kind: PrometheusServiceLevel
metadata:
  name: slo-test
  labels:
    prometheus: prometheus
    role: alert-rules
spec:
  service: "test"
  slos:
    - name: "five-nines"
      objective: 99.999
      sli:
        plugin:
          id: "sloth-common/fake"
          options:
            burn_rate: "0.65"
            jitter_percent: "10"
      alerting:
        name: "TestSLOFiveNinesFailing"
        pageAlert:
          disable: true
        ticketAlert:
          disable: true

from sloth.

mccricardo avatar mccricardo commented on July 21, 2024

@slok do you think adding a vector(0) in this case would make sense?

1-(
  sum_over_time(
    (
       slo:sli_error:ratio_rate1h{sloth_service="${service}",sloth_slo="${slo}"}
       * on() group_left() (
         month() == bool vector(${__to:date:M})
       )
    )[32d:1h]
  )
  / on(sloth_id)
  (
    slo:error_budget:ratio{sloth_service="${service}",sloth_slo="${slo}"} *on() group_left() (24 * days_in_month())
  ) or vector(0)
) 

from sloth.

mo3athi avatar mo3athi commented on July 21, 2024

Hi @slok I do have the same problem, here's a screenshot for the fake plugin as you mentioned on your last comment:
sloth-test-fake

I'm using the helm chart version
I don't see anything wrong on the sloth pod logs:
INFO[0000] SLI plugins loaded plugins=0 svc=storage.FileSLIPlugin version=v0.9.0 window=30d INFO[0000] SLO period windows loaded svc=alert.WindowsRepo version=v0.9.0 window=30d windows=2 INFO[0000] Loading Kubernetes configuration... version=v0.9.0 INFO[0000] Kubernetes controller running version=v0.9.0 window=30d INFO[0000] Hot-reload http server listening addr=":8082" version=v0.9.0 window=30d INFO[0000] Metrics http server listening addr=":8081" version=v0.9.0 window=30d INFO[0000] Hot-reload manager running version=v0.9.0 window=30d INFO[0000] OS signals listener started version=v0.9.0 window=30d INFO[0000] starting controller controller-id=sloth lib=kooper service=kooper.controller version=v0.9.0 window=30d INFO[0001] Hot-reload triggered from http webhook version=v0.9.0 window=30d INFO[0001] SLI plugins loaded plugins=15 svc=storage.FileSLIPlugin version=v0.9.0 window=30d
Thank you!

from sloth.

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.