Skip to main content
Version: Next

Callbacks

When do callbacks trigger?#

All configured callbacks are triggered whenever nzyme detects a new alert. If you have an alert that is active for multiple hours, nzyme will only trigger the callbacks for this alert when it sees it for the first time and not subsequently using a grace period configuration.

Configuration#

You can find the alert callbacks configuration in the nzyme.conf file of your leader instance.

An example configuration looks like this, nested under the alerting section.

alerting {  # Notifications and callbacks for triggered alerts.  callbacks: [    {      type: email      enabled: false
      # One of: SMTP, SMTPS or SMTP_TLS      transport_strategy: SMTP_TLS
      host: smtp.example.org      port: 587      username: "your_username"      password: "your_password"
      from: "nzyme <nzyme@example.org>"      subject_prefix: "[NZYME]"
      recipients: [        "Somebody <somebody@example.org>",        "Somebody Else <somebody.else@example.org>"      ]    }  ]}

When you look at the callbacks variable, you will notice that its value is an array and that you can configure as many callbacks as you want.

You can also configure multiple callbacks of the same type. For example, if you want to have two differently configured email callbacks, you can set two independent callbacks in the callbacks array.

Callback type: Email/SMTP#

This callback sends an email to all configured recipients via SMTP.

{  type: email  enabled: false
  # One of: SMTP, SMTPS or SMTP_TLS  transport_strategy: SMTP_TLS
  host: smtp.example.org  port: 587  username: "your_username"  password: "your_password"
  from: "nzyme <nzyme@example.org>"  subject_prefix: "[NZYME]"
  recipients: [    "Somebody <somebody@example.org>",    "Somebody Else <somebody.else@example.org>"  ]}
  • transport_strategy: One of SMTP, SMTPS or SMTP_TLS
  • host: The SMTP server to use
  • port: The port of the SMTP server to use
  • username/password: The username and password combination used to authenticate with the SMTP server (We recommend to use quotes to avoid escaping issues)
  • from: The "from" address to use. Must be in full email address format that describes both the name and email address: "Some Body somebody@example.org"
  • subject_prefix: A prefix for the subject line of the email
  • recipients: A list of recipients for the email. Must be in full email address format that describes both the name and email address: "Some Body somebody@example.org"

Email Screenshot