Imison.Notifications.Channels.Webhook (Imison v0.1.0)

Copy Markdown View Source

POSTs each notification as JSON to a URL of your choice.

Its stored settings are the url (http or https) and an optional signing secret: %{"url" => "https://hooks.example.com/imison", "secret" => "..."}. It isn't in the default channels; add it there to show its panel on the Notifications screen.

The body (content-type: application/json) is the Imison.Notifications.Message as an object: trigger, error_id, kind, message, location, occurrence_count, first_seen_at, last_seen_at, regressed_at, url and summary (for the daily digest its date, url and the sections new, came_back and most_frequent, each lines of error_id, kind, message, location, count and url with a total; else null), times in ISO 8601 and unset fields as null.

With a secret, each request carries x-imison-timestamp (Unix seconds) and x-imison-signature: sha256=<hex>, the lowercase hex HMAC-SHA256 of <timestamp>.<body> keyed with the secret.

A 2xx answer is a delivery; any other answer fails it with {:http_status, status}, and a connection that fails, takes over 5 seconds to open or over 5 more to answer fails it with the reason, so a delivery (and "Send test", which waits for it) takes at most about 10 seconds. Redirects aren't followed. Failures never name the URL or the secret.