Skip to content

Notifier HTTP

Todd Palino edited this page Jul 22, 2020 · 2 revisions

The "http" notifier module responds to consumer group status evaluations and makes HTTP calls to an outside server. This is a general tool that can be used for a variety of services:

  • Calling out to an internal metrics or alerting system
  • Sending Slack messages
  • Triggering an action in any service with an HTTP API

Configuration

The subheading must be a unique name, such as [notifier.tellme]. The "tellme" part is the name that will be used when logging. The configs specified below are in addition to the ones specified for all notifiers on the Configuration page.

[notifier.tellme]
class-name="http"
interval=30
threshold=3
group-allowlist="^important-group-prefix.*$"
group-denylist="^not-this-group$"
extras={ key1="value1", key2="value2" }
send-close=true
template-open="path/to/file1.tmpl"
template-close="path/to/file2.tmpl"
Key Value Type Required Default Value Description
class-name string yes (empty) This is the name of the notifier module type. For this module, it must be "http"
interval integer no 60 The number of seconds to wait between sending notifications for a single group.
threshold integer no 2 The minimum group status to send out notifications for (refer to StatusConstant for values).
group-allowlist string (regex) no (empty) If specified, only send notifications for groups that match this regular expression.
group-denylist string (regex) no (empty) If specified, only send notifications for groups that DO NOT match this regular expression. This is processed after the allowlist (if specified).
extras map (string -> string) no (empty) A map of values that will be available when compiling the template for the message to send.
send-close boolean no false If true, use the template-close template to send a notification when the group status drops to OK (after it has been WARN or above).
template-open path yes (empty) The path and filename of a template file that is used to compile the message to send for groups that pass the allowlist and status threshold (see Templates for more information on building the template).
template-close path no (empty) The path and filename of a template file that is used to compile the message to send for groups that transition to OK (if send-close is true).
url-open string yes (empty) The URL to make a request to for groups that meet the threshold.
method-open string no POST The HTTP method to use when making requests for "open" groups.
url-close string no (empty) The URL to make a request to for groups that have transitioned back to OK from a bad state (WARN or above), if send-close is true.
method-close string no POST The HTTP method to use when making requests for "closed" groups.
timeout integer no 5 The timeout, in seconds, to use on HTTP connections.
keepalive integer no 300 How long to maintain a connection and use keepalive.

Template Usage

The templates are used to make up the message body, such as in a POST request (though it will be sent for any request type). For details on creating templates for notifiers, please see the Templates page.