Area: Observability
Sub-Area: Notifications
Applies to: OSS + Cloud
Issue
Slack notifications for assertions, incidents or other DataHub events are not arriving in Slack.
The DataHub Slack App (notifications, subscriptions, Ask DataHub and /datahub commands) is DataHub Cloud only. Self-hosted OSS DataHub does not have it. OSS can send Slack messages with the slack action in DataHub Actions. The steps for each are below.
You Might Be Asking
- How do I check that DataHub can post to Slack?
- Why does my test notification work but real notifications do not arrive?
- How do I set up Slack notifications on self-hosted DataHub?
- Can I send different alerts to different channels?
Cause
DataHub Cloud:
- The connection between DataHub and Slack needs to be re-connected. The test notification tells you to re-connect DataHub to Slack.
- Slack needed a workspace admin to approve the app, and the install was never finished.
- The channel is private and the DataHub Slack app has not been invited to it.
- You are the person who made the change. People are never notified about their own actions.
- A user has not connected their own DataHub account to Slack. Starting in v0.3.17, users connect their Slack account to receive Slack direct messages.
OSS: the slack action is not configured with its own keys (bot_token, signing_secret, default_channel), or the event is not one the action processes.
Solution
DataHub Cloud
Cloud notifications come from the built-in DataHub Slack App. You do not run DataHub Actions or create a Slack incoming webhook for it.
-
Send a test notification. Go to
<your-datahub-url>/settings/notifications, enter a channel and click Send a test notification. You can also use it from a subscription drawer. If the test fails, the modal describes the error. See Troubleshoot Slack Issues. -
If the test tells you to re-connect DataHub to Slack, refresh the existing app. The person who first installed the app generates new App Configuration tokens at api.slack.com/apps (delete expired ones), pastes them into the DataHub Slack Integration setup page and clicks Re-connect.
- The other option is to create a new installation. A new installation needs the bot re-invited into every private channel the old bot was in. Uninstall the old app from the workspace's Manage Apps page.
-
If Slack asked for workspace admin approval during install, click the button to request approval. When it is approved, the Slack bot sends a message with a link that finishes the install. If that message never arrives, open the DataHub app at api.slack.com/apps and finish the installation there. Then send a test notification again. See workspace admin approval.
-
For a private channel, invite the DataHub Slack app to the channel first. The app can post to public channels without an invite. You can enter a channel name (for example
#troubleshoot) or a channel ID (for exampleC029A3M079U). The docs recommend the name. See Slack destinations. -
If the test works but real notifications do not arrive, check whether you made the change yourself. People are never notified about their own actions. If that is not the cause, contact DataHub Support. See Test notification works, but not receiving notifications.
-
For direct messages to a person, starting in v0.3.17 the user connects their account. Go to Settings > Notifications and click Connect to Slack under Slack Notifications. Slack asks for OAuth confirmation and sends you back to DataHub. To relink, for example after changing Slack workspaces, click Reconnect. You can no longer set a Slack Member ID by hand. See Connect your Slack account.
-
If Slack commands such as
/datahubfail withdispatch_failed, do a Manual Installation Refresh. Open<your-datahub-url>/settings/integrations/slack?display_all_configs=trueand switch to the Bot Token tab. Re-enter the Bot Token (api.slack.com/apps, under OAuth & Permissions) and the Signing Secret, then click Update Configuration.
To send different alerts to different channels, set a default Slack channel and override it for each asset when you subscribe. You can set one default email and Slack channel at the user and group level. Creating and managing group subscriptions requires the Manage Group Notification Settings and Manage Group Subscriptions privileges. See Subscriptions & Notifications.
OSS (self-hosted DataHub Actions)
-
Create a Slack app. Note its Signing Secret (Basic Information > App Credentials) and its Bot User OAuth Token (OAuth & Permissions). The action does not use an incoming webhook. Add the app to the target channel.
-
Install the action with
pip install "acryl-datahub-actions[slack]". The docker quickstart and helm images already include it. -
On quickstart or helm, set these environment variables and restart the
datahub-actionscontainer:DATAHUB_ACTIONS_SLACK_ENABLED=trueDATAHUB_ACTIONS_SLACK_SIGNING_SECRETDATAHUB_ACTIONS_SLACK_BOT_TOKENDATAHUB_ACTIONS_SLACK_CHANNELDATAHUB_ACTIONS_SLACK_DATAHUB_BASE_URL
-
Or write your own recipe. The only action config keys are
bot_token(required),signing_secret(required),default_channel(required, a Slack channel ID),base_url(defaulthttp://localhost:9002/) andsuppress_system_activity(defaulttrue). Any other key is rejected.
name: "slack-notifications"
source:
type: "kafka"
config:
connection:
bootstrap: "<kafka-bootstrap>"
schema_registry_url: "<schema-registry-url>"
action:
type: "slack"
config:
bot_token: "<bot-token>"
signing_secret: "<signing-secret>"
default_channel: "<channel-id>"
base_url: "<your-datahub-url>"
- The Kafka connection block has no
consumer_groupkey. The consumer group id is always the pipelinename. - The action processes only
EntityChangeEvent_v1events. It does not processMetadataChangeLogEvent_v1. It logs and skips every other event. - The action has no message template and no channel routing options. It sends every message to the single
default_channel, with no per-event or per-entity routing. When it starts, it posts a welcome message to that channel. After that it posts one message per event to the same channel. It limitspost_messageto 1 call per second. - With
suppress_system_activityset totrue(the default), the action drops changes made by the DataHub system actor. It has no filter for a person's own changes.
- To limit which events are sent, set filters at the top level of the pipeline, not under
action.config:
filters:
- type: event_type
config:
filter:
EntityChangeEvent_v1:
event:
- category: TAG
The older single filter: block still works but is deprecated. See Actions filters.