Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide streams like runs but on duration #788

Closed
mcorbin opened this issue Mar 20, 2017 · 1 comment
Closed

provide streams like runs but on duration #788

mcorbin opened this issue Mar 20, 2017 · 1 comment

Comments

@mcorbin
Copy link
Contributor

mcorbin commented Mar 20, 2017

I think it may be useful to have streams like (runs) but on duration instead of moving-event-window.

For example, i want to be alerted if :metric is > to a threshold (600 for example) during 5 minutes. It would be nice to have :

(above 600 300 children)

If an event arrives at time 0 with :metric = 700, and a second event arrives at time 301 with :metric = 750, above passes on the last event.

Another example with a test case :

(test-stream (above 10 5) [{:time 0
                            :metric 2}  ;; metric < 10
                           {:time 6
                            :metric 11} ;; metric > 10, valid event
                           {:time 12 ;; metric > 10, 12 - 6 > 5 => send to children
                            :metric 11}] [{:time 12
                                           :metric 11}])

More generally, we could have a stream called cond-dt taking a function of events, a duration, and children, and use it to creates for example the above stream :

(defn above
  [threshold dt & children]
  (apply cond-dt (fn [event] (> (:metric event) threshold)) dt children))

I am working on it actually (i will do a PR tomorrow), do you think it can be useful to integrate it into Riemann ?

@mcorbin
Copy link
Contributor Author

mcorbin commented Jul 18, 2017

cf #789 and https://github.com/mcorbin/riemann-cond-dt-plugin ;)

@mcorbin mcorbin closed this as completed Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant