Enabling DQ alert notifications via Email & Slack
This article describes how to set up alert notifications for your CDQ environment. I’ll give instructions for 2 different ways of receiving the alerts - via Email and via Slack . So let’s go…
Base setup for sending alerts
In order to be able to send alerts you’ll have to provide the credentials for an Email account from which the alerts will be sent. (For this i’ve setup a GMail account called [email protected]) To do this, you click the “Gear” icon in the DQ panel and choose “Alerts”.
The credentials i use are as follows: (you’re welcome to use them as well)
SMTP Host: smtp.gmail.com
SMTP Port: 587
SMTP Username: [email protected]
SMTP Password: Collibra2022!
For “Default To Email” and “Reply Email” you can put in your Collibra email address
Of course you’re free to set up your own email account and provide your own credentials.
Creating an alert definition
In the next step we’ll create an alert definition so we really receive an EMail from DQ. To do this, you click the “Bell” icon in the DQ panel and choose “Alert Definitions”. Then choose your data set and create a new alert definition.
For my test i used the following alert definition parameters:
Alert Name: Job finished successfully
Condition: score >= 0 (so the Email will always be sent)
Alert Recipient: << your Collibra email address>>
Custom Msg: Hi DQ-Admin, your job for Purchase Mock data completed <b>successfully</b>. <p>Click here to see details: <a href="http://34.107.64.67:9000/dq/hoot?dataset=purchase_data_mock5_csv_1&runId=2022-02-20T00:00:00.000+0000">Job Details in Collibra DQ</a>
Two things to note here: a) yes, you can include HTML formatting in the mail, which is great and b) the URL is hardcoded (not so great), so it’s not usable for a customer production environment. For a demo, it should do…
I’ve tried to find a way on how to dynamically include a link the DQ Hoot page, but no luck. If anyone from DQ PM reads this: It would be AWESOME if you could include a link to the hoot page in the alert mail. (Or, maybe there’s already a way to do it and i just couldn’t find it. In this case - let me know😉 )
Anyway - if you then run your DQ job, you’ll receive an Email like this in your inbox. Bonus: You can click the (hardcoded) link and you’ll be directly taken to the DQ hoot page ( BTW: The first time i sent the Email to my Collibra email address it was recognized as spam and i had to look in the Spam folder. Just fyi…)
With this we’re done for the Email notification!
Setting up for Slack notifications
After having the Email setup in place, i thought to myself that it would be really cool if i can get the DQ alert as a Slack message. So the following setup steps will describe just that.
First you need to create a new channel in Slack - i called mine “collibra-dq-alerts”. Once you’ve done that, we need to enable the Email integration - that means, one can send an Email to this Slack channel. In order to enable it, you have to go to the channel’s configuration by clicking the little “down arrow” next to the channel name (see screenshot):
The channel configuration pop-up will apear, and there you choose the “Integrations” tab and click the “Send emails to this channel” button.
Slack will now generate an email address that can be used to send messages to the channel. Copy it to the clipboard. In addition you can customize how Email messages will appear in the channel (i chose the DQ logo)
So that’s all you have to do. The last step is to use the newly generated email address as the recipient of your alert definition. Once everything is setup and alerts get sent to Slack, it looks like this:
Hope this is useful and you can spice up your next DQ demo with some nice Email and Slack alerts!