Slack Publish API¶
Want to publish alerts to Slack?
The source code reference guide is below and here is the intro to publishing alerts to Slack as a Jupyter Notebook.
Send Celery Task Details to Slack Utilities¶
Helper for extracting details from Celery task and sending it to a slack webhook.
Supported environment variables:
# slack webhook
export SLACK_WEBHOOK=https://hooks.slack.com/services/
-
analysis_engine.send_to_slack.post_df(df, columns=None, block=True, jupyter=True, full_width=True, tablefmt='github')[source]¶ Post a
pandas.DataFrameto SlackParameters: - df –
pandas.DataFrameobject - columns – ordered list of columns to for the table
header row
(
Noneby default) - block – bool for
post as a Slack-formatted block
`like this`(Trueby default) - jupyter – bool for
jupyter attachment handling
(
Trueby default) - full_width – bool to ensure the width is preserved
the Slack message (
Trueby default) - tablefmt – string for table format (
githubby default). Additional format values can be found on: https://bitbucket.org/astanin/python-tabulate
- df –
-
analysis_engine.send_to_slack.post_success(msg, jupyter=False, block=False, full_width=False)[source]¶ Post a SUCCESS message to slack
Parameters: msg – A string, list, or dict to send to slack
-
analysis_engine.send_to_slack.post_failure(msg, jupyter=False, block=False, full_width=False)[source]¶ Post a FAILURE message to slack
Parameters: msg – A string, list, or dict to send to slack
-
analysis_engine.send_to_slack.post_message(msg, jupyter=False, block=False, full_width=False)[source]¶ Post any message to slack
Parameters: msg – A string, list, or dict to send to slack