Giter Club home page Giter Club logo

Comments (1)

tokheim avatar tokheim commented on August 22, 2024 1

At least you first need prometheus to record maintenance windows. Either some system that reports this as metric, or if its a fixed time, you could build a recording rule with the day_of_week and hour functions.

Then I'd probably cut my losses and just define a inhibit rule to avoid sending alerts during maintenance period (maybe add a buffer around the period). The slo calculations and boards would still take errors during maintenance period into account though. I would find that advantageous though as I'd anyways encourage trying to limit impact of maintenance periods.

Still if you really need calculations to exclude maintenance periods, then the approach would likely depend on your query. Assuming maintenance_period recording rule that reports 1 during mainteance, 0 otherwise, then maybe queries like this would do the trick

  error_query: |
    sum_over_time((
        sum(rate(<error_counter>[30s]))
        * scalar(1-maintenance_period)
    )[{{.window}}:])
  total_query: |
    (sum_over_time((
        sum(rate(<total_counter>[30s]))
        * scalar(1-maintenance_period)
    )[{{.window}}:]) > 0) or vector(1)

Basically if you take rate over full window period, you wouldn't know which errors happened during maintenance period. sum_over_time should still ensure the error ratio is a quite good approximation for the entire window period. > 0 or vector(1) will be quite important to include as the error ratios would otherwise have 0 denominator inside any maintenance period

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.