Customizing Apache Superset to Send Alerts via Webhook (REST API) Instead of Email/Slack #33268
Replies: 13 comments
|
Can you add more details regarding what alert data/details you're looking to send to the webhook? I would look into the following files to get started: |
|
Hi everyone, I'm currently working on integrating custom webhook notifications for alerts in Apache Superset. My goal is to send alert messages to a POST REST API instead of using traditional notification methods like email or Slack. What I’ve Implemented: Custom Webhook Notification Method: I've created a custom script (webhook.py) to handle the notifications. Alert Configuration: I’ve set up alerts that should trigger based on certain conditions in my database.
Basically, I created this alert from the REST API - http://0.0.0.0:8088/api/v1/report/ (for creating alerts) with the payload -
Database Testing: I’ve mocked the data by adding records to the database and verified that the alerts should be triggered when the conditions are met. Issues Encountered: superset/reports/models.py superset/reports/notifications/Base.py Superset_Config.py Celery and Redis are running correctly -
Request for Help: I would appreciate any insights or suggestions on troubleshooting this issue. |
|
big vote for this feature |
|
Hello Community, Any update on the above request. |
|
Your ideas are great. The feature I'm developing happens to include what you mentioned. Webhook is quite good because the integration of enterprise-level instant messaging is too scattered. Function: At the same time, the alarm data source will be passed to the finely tuned large model, the analysis report will be generated and pushed synchronously after adding hyperlinks. The expected method is to use the salted symmetric SHA3 algorithm to encrypt private data and ensure data security. Currently, this feature is still in the development stage. If it is completed, I will contribute. Version↓ : |
|
One extremely useful feature would be if, instead of constructing the webhook payload directly in python, you allowed users to provide a Jinja template. Then you could feed the alert results into that template. That would be much more versatile than having people maintain custom python libraries. Also, maybe tap into the existing alerts UI instead of making your own? |
@Jerome-LJ i have the same problem,and my superset version is also 4.1.0,do you solve the problem |
|
I'm planning to convert this from an Issue to a Discussion. I'm very much in favor of the feature (I even have personal use cases), but it's not a "bug" really :) That said, I'll leave it here in case others (e.g. @mistercrunch @villebro @michael-s-molina) think this might warrant a SIP. I don't think it does, unless it presents any potential security risk that would require further scrutiny. |
|
Seems like a great use case. Now wondering what should be in the payload that we send to the webhook. It seems the most important/useful thing would be a URL to the chart or dashboard associated with the alert. Not sure if POSTing the chart/dashboard definition/metadata is useful in any cases here... Oh also, maybe a link to a thumbnail and/or rendered image of the dashboard/chart would be great too, so the external system can show what's up. |
|
I'm still very much in favor of this feature, and it just resurfaced in a Slack conversation about sending alerts via SMS (which would be possible with a webhook and a service like Twilio. I'll move this to a Discussion, rather than an Issue (since it's not a bug), but I'd love to see this happen if anyone here is interested in getting involved. |
|
https://blog.marun.run/p/superset-config-webhook-report/#add-report-channel 添加了一个简单的飞书机器人消息发送 Added a simple Lark robot messaging |
|
Hello @rusackas, I am Ishika, a fourth year student at U of T. My team (Offline) and I would to like to contribute and help add Webhook to enable superset to send alerts. Thanks. |




Uh oh!
There was an error while loading. Please reload this page.
Hello Superset Community,
I’m working on a project where we need to send alerts to a webhook (REST API) with alert details, rather than using the default email or Slack notification channels provided by Superset. I’m looking to customize Superset to achieve this functionality.
Requirements
Custom Notification Channel: Implement a webhook (REST API) to receive alerts.
Alert Details: The webhook should receive detailed information about the alert.
Customization Steps
I understand that to implement this, modifications will likely be needed in the following areas:
Notification Handler:
Implement a custom notification handler to send alerts to the webhook.
The class might need to extend BaseNotifier from superset.tasks.notifications.base.
Configuration Files:
Update superset_config.py to register the new notification handler.
Ensure the new webhook handler is included in the notification listeners.
Alerting Component:
Modify or extend alert creation and management to support webhook notifications.
Questions
Files to Modify: What specific files and classes should be modified to integrate a custom webhook for alerts?
Implementation Guidance: Could you provide guidance on implementing a custom notifier for webhooks? Any code snippets or references would be greatly appreciated.
Testing: What’s the best way to test this integration to ensure that alerts are properly sent to the webhook?
Any assistance or pointers to relevant documentation would be greatly appreciated!
All reactions