riemann.opsgenie

Forwards events to OpsGenie

alerts-url

api-alias

(api-alias event)

Generate OpsGenie alias based on event

close-alert

(close-alert api-key event body-fn)

Close alert in OpsGenie

create-alert

(create-alert api-key event body-fn)

Create alert in OpsGenie

default-body

(default-body event)

default-options

description

(description event)

Generate message based on event

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))))

post

(post url body headers)

Post to OpsGenie