Discord webhook alerts
Early access preview
This feature is in preview phase and is available in Dagster+ in limited early access. Functionality and APIs may change as we continue development. To get early access to this feature, reach out to your Dagster account team. For more information, see the API lifecycle stages documentation.
This guide shows how to send custom notifications to a Discord channel using Discord Webhooks.
Step 1: Setup a webhook in Discord
- In Discord, go to Server Settings > Integrations > Webhooks.
- Create a new Webhook and copy the Webhook URL.
- [Recommended] Save the tokens at the end of the generated URL as a Dagster+ environment variable (e.g.
DISCORD_WEBHOOK_TOKEN). - Set the URL in the Alert Policy Webhook configuration (e.g.
https://discord.com/api/webhooks/{env.DISCORD_WEBHOOK_TOKEN})
Step 2: Configure your webhook payload
This example utilizes Discord "Embeds" for rich formatting.
{
"username": "Dagster+ Alerts",
"embeds": [
{
"title": "Alert: {{alert_summary}}",
"url": "{{deployment_url}}",
"description": "\n{{alert_content}}",
"color": 15158332,
"fields": [{"name": "Deployment", "value": "{{deployment_name}}", "inline": true}],
"footer": {"text": "Alert policy: {{alert_policy_name}}"}
}
]
}
Official References
- Discord Webhooks Guide: Basic setup instructions.
- Embed Object Structure: Customize colors, fields, and images.
- Execute Webhook API: Full API parameters documentation.