GithubHelp home page GithubHelp logo

Comments (5)

nixwiz avatar nixwiz commented on June 16, 2024 1

How about something like this where I could keep my default of 1? My arguments being most checks I have ever worked on I would prefer notification on first failure and this has been out long enough with this as the default that I don't want to break anybody's implementation by changing it.

function fatigue_check(event, occurrences = 1) {

    // my defaults
    // remove this var occurrences = 1;          // only the first occurrence
    var interval = 1800;          // and every 30 minutes thereafter
    var allow_resolution = true;  // allow resolution events through
    var suppress_flapping = true; // suppress when flapping

Where the resource would be:

{
  "type": "EventFilter",
  "api_version": "core/v2",
  "metadata": {
    "name": "fatigue_check_allow_two_failures",
    "namespace": "default"
  },
  "spec": {
    "action": "allow",
    "expressions": [
      "fatigue_check(event, 2)"
    ],
    "runtime_assets": [
      "fatigue-check-filter"
    ]
  }
}

This way by using this filter you could then have this as the default for any check that has this filter assigned to its handler(s).

from sensu-go-fatigue-check-filter.

nixwiz avatar nixwiz commented on June 16, 2024 1

Sure, that will be an easy non-breaking change and i'll work on it this weekend. I'll wind up spending more time on the unit tests for it than the actual code.

from sensu-go-fatigue-check-filter.

VeselaHouba avatar VeselaHouba commented on June 16, 2024 1

Awesome, thanks mate.

from sensu-go-fatigue-check-filter.

VeselaHouba avatar VeselaHouba commented on June 16, 2024

Yes, that was exactly what I was thinking of. I didn't want to change default values in code, only have option to override them if someone wants to.

from sensu-go-fatigue-check-filter.

nixwiz avatar nixwiz commented on June 16, 2024

Done and available in version 0.6.1 and is on Bonsai.

Closed by #18

from sensu-go-fatigue-check-filter.

Related Issues (15)

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.