Skip to main content
Alerts fire automatically when createBackup() completes — you don’t have to do anything. This page covers how to customize or trigger alerts manually.

Automatic alerts

Provided the alerts section of your config is enabled, success and failure notifications go out after each backup.

Manual alerts

For custom events (not tied to a DBDock backup operation), use AlertService:

Methods

sendSuccess(details)

sendFailure(details)

sendTest()

Sends a test notification to all configured channels. Same as npx dbdock test.

Controlling channel delivery

Alerts go to every enabled channel. To send to only one channel, configure your dbdock.config.json to enable only that channel:
Or programmatically toggle by reloading config per-environment.

Custom alert content

If the built-in alert content doesn’t fit your needs, use your own alerting code and disable DBDock’s alerts:
This gives you full control at the cost of reimplementing the built-in content.

Reliability notes

  • Alert delivery is best-effort — network errors don’t fail the backup
  • Alerts are sent after the backup completes, so a failure during delivery doesn’t delete the backup
  • For critical alerting, use a dedicated alerting service (PagerDuty, Opsgenie) fronted by a webhook — see Custom webhooks

See also

Alerts overview

Available channels.

Custom webhooks

Integrate with any HTTP endpoint.