{"id":18731001,"url":"https://github.com/mcorbin/riemann-cond-dt-plugin","last_synced_at":"2025-04-12T17:34:25.197Z","repository":{"id":62434454,"uuid":"96982903","full_name":"mcorbin/riemann-cond-dt-plugin","owner":"mcorbin","description":"A plugin for verifying that a condition on an event is true during a time period.","archived":false,"fork":false,"pushed_at":"2018-01-17T22:21:19.000Z","size":17,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T11:51:14.894Z","etag":null,"topics":["alerting","monitoring","riemann"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcorbin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-12T08:18:05.000Z","updated_at":"2024-08-01T14:31:08.000Z","dependencies_parsed_at":"2022-11-01T21:15:45.895Z","dependency_job_id":null,"html_url":"https://github.com/mcorbin/riemann-cond-dt-plugin","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcorbin%2Friemann-cond-dt-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcorbin%2Friemann-cond-dt-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcorbin%2Friemann-cond-dt-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcorbin%2Friemann-cond-dt-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcorbin","download_url":"https://codeload.github.com/mcorbin/riemann-cond-dt-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248605704,"owners_count":21132220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alerting","monitoring","riemann"],"created_at":"2024-11-07T14:51:53.802Z","updated_at":"2025-04-12T17:34:25.164Z","avatar_url":"https://github.com/mcorbin.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# riemann-cond-dt-plugin\n\nA plugin for verifying that a condition on an event is true during a time period.\n\n[![Clojars Project](https://img.shields.io/clojars/v/riemann-cond-dt.svg)](https://clojars.org/riemann-cond-dt)\n\n## Howto\n\n### Loading the plugin\n\nFirst, you should download the .jar file, and tell Riemann how to find it in your system using the `/etc/default/riemann` or `/etc/sysconfig/riemann` file and the EXTRA_CLASSPATH option.\n\nThen, on your `riemann.config` file, add:\n\n```clojure\n(load-plugins)\n\n(require '[riemann-cond-dt.core :as cd])\n```\n\nYou are now ready to use the plugin !\n\n### Streams\n\n#### above\nTakes a number `threshold` and a time period in seconds `dt`.\n\nIf the condition `(\u003e (:metric event) threshold)` is valid for all events received during at least the period `dt`, valid events received after the `dt` period will be passed on until an invalid event arrives.\n\n`:metric` should not be nil (it will produce exceptions).\n\n```clojure\n(cd/above 1000 60 #(info %))\n```\n\n#### below\n\nTakes a number `threshold` and a time period in seconds `dt`.\n\nIf the condition `(\u003c (:metric event) threshold)` is valid for all events received during at least the period `dt`, valid events received after the `dt` period will be passed on until an invalid event arrives.\n\n`:metric` should not be nil (it will produce exceptions).\n\n\n```clojure\n(cd/below 1000 60 #(info %))\n```\n\n##### between\n\nTakes two numbers, `low` and `high`, and a time period in seconds, `dt`.\n\nIf the condition `(and (\u003e (:metric event) low) (\u003c (:metric event) high))` is valid for all events received during at least the period `dt`, valid events received after the `dt` period will be passed on until an invalid event arrives.\n\n`:metric` should not be nil (it will produce exceptions).\"\n\n```clojure\n(cd/between 1000 10000 60 #(info %))\n```\n\n#### outside\n\nTakes two numbers, `low` and `high`, and a time period in seconds, `dt`.\n\nIf the condition `(or (\u003c (:metric event) low) (\u003e (:metric event) high))` is valid for all events received during at least the period `dt`, valid events received after the `dt` period will be passed on until an invalid event arrives.\n\n`:metric` should not be nil (it will produce exceptions).\n\n```clojure\n(cd/outside 1000 10000 60 #(info %))\n```\n\n#### critical\n\nTakes a time period in seconds `dt`.\n\nIf all events received during at least the period `dt` have `:state` critical, new critical events received after the `dt` period will be passed on until an invalid event arrives.\n\n```clojure\n(cd/critical 60 #(info %))\n```\n\n#### cond-dt\n\nA stream which detects if a condition `(f event)` is true during `dt` seconds.\nTakes a function of events `f` and a time period `dt` in seconds.\n\nIf the condition is valid for all events received during at least the period `dt`, valid events received after the `dt` period will be passed on until an invalid event arrives.\n\nSkips events that are too old or that do not have a timestamp.\n\nFor example, you can reimplement `critical` using `cond-dt`:\n\n```clojure\n(cd/cond-dt (fn [event] (= (:state event) \"critical\")) 60 #(info %))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcorbin%2Friemann-cond-dt-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcorbin%2Friemann-cond-dt-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcorbin%2Friemann-cond-dt-plugin/lists"}