riemann.opsgenie
Forwards events to OpsGenie
message
(message event)
Generate description based on event. Because service might be quite long and opsgenie limits message, it pulls more important info into beginning of the string
opsgenie
(opsgenie options)
Creates an OpsGenie adapter. Takes options, and returns a map of functions which trigger and resolve events. By default, Clojure/hash from event host, service and tags will be used as the alias.
Options:
- :api-key Your Opsgenie API key
- :body-fn A function used to generate the HTTP request body. default to
default-body
. This function should accept an event and return a map containing at least the:message
and:alias
keys.
(let [og (opsgenie {:api-key "my-api-key"})]
(changed-state
(where (state "ok") (:resolve og))
(where (state "critical") (:trigger og))))