Add your description here
Project description
Metaflow Slack Notification Plugin
A Metaflow plugin that sends detailed error notifications to Slack when a flow step fails. This helps teams monitor their Metaflow pipelines and quickly respond to failures.
Features
- Automatic Slack notifications on step failures
- Detailed error information including:
- Flow details
- Retry count and limits
- Flow parameters
- Input data
- Full stack trace
- Easy integration with existing Metaflow pipelines
Installation
pip install metaflow-slack-notifier
Configuration
Set the following environment variables:
export METAFLOW_SLACK_APP_TOKEN="xoxb-your-token"
export METAFLOW_SLACK_CHANNEL="your-channel"
or use @environment decorator:
@environment(vars={"METAFLOW_SLACK_APP_TOKEN": "xoxb-your-token", "METAFLOW_SLACK_CHANNEL": "your-channel"})
@slack()
@step
def some_step(self):
# write your code
print("end")
Usage
Add the @slack decorator to any step that you want to monitor.
from metaflow import FlowSpec, slack, step
import os
token = os.getenv("METAFLOW_SLACK_APP_TOKEN")
channel = os.getenv("METAFLOW_SLACK_CHANNEL")
class MyFlow(FlowSpec):
@step
def start(self):
print("start")
self.next(self.end)
@slack(token=token, channel=channel)
@step
def end(self):
# This will trigger a Slack notification due to ZeroDivisionError
1 / 0
print("end")
if __name__ == "__main__":
MyFlow()
When the step fails, you'll receive a notification in your Slack channel with the error details.
Slack App Setup
- Create a new Slack App in your workspace
- Enable the following OAuth scopes:
- chat:write
- chat:write.public (if sending to public channels)
- Install the app to your workspace
- Copy the Bot User OAuth Token (starts with xoxb-)
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metaflow_slack_notifier-0.1.0.tar.gz.
File metadata
- Download URL: metaflow_slack_notifier-0.1.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
845a993232fabff667bfe2fa3b0cebe04a4380a4e5b063af319b4eac8792c21b
|
|
| MD5 |
becfe08f9ee479b255239227a1956ce0
|
|
| BLAKE2b-256 |
b2d2414b725feb4309b8f483d64a5adf7c36f112d5870d7c24692124ebaf8986
|
Provenance
The following attestation bundles were made for metaflow_slack_notifier-0.1.0.tar.gz:
Publisher:
publish.yaml on t-chov/metaflow_slack_notifier
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaflow_slack_notifier-0.1.0.tar.gz -
Subject digest:
845a993232fabff667bfe2fa3b0cebe04a4380a4e5b063af319b4eac8792c21b - Sigstore transparency entry: 159804040
- Sigstore integration time:
-
Permalink:
t-chov/metaflow_slack_notifier@08e1aba26bd18a2fbc0b64d56dfc59082ba8805b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/t-chov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@08e1aba26bd18a2fbc0b64d56dfc59082ba8805b -
Trigger Event:
push
-
Statement type:
File details
Details for the file metaflow_slack_notifier-0.1.0-py3-none-any.whl.
File metadata
- Download URL: metaflow_slack_notifier-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e929ba43cf607041bd450a4f7fe8f3fa2d94b69f8720bf61563d254637519b0
|
|
| MD5 |
d4abdf4f328c6ac23fb652153f07901d
|
|
| BLAKE2b-256 |
12559a0546766e7ad219afecf02ad6892da3705254df44a85e03863ad4f32e82
|
Provenance
The following attestation bundles were made for metaflow_slack_notifier-0.1.0-py3-none-any.whl:
Publisher:
publish.yaml on t-chov/metaflow_slack_notifier
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaflow_slack_notifier-0.1.0-py3-none-any.whl -
Subject digest:
4e929ba43cf607041bd450a4f7fe8f3fa2d94b69f8720bf61563d254637519b0 - Sigstore transparency entry: 159804041
- Sigstore integration time:
-
Permalink:
t-chov/metaflow_slack_notifier@08e1aba26bd18a2fbc0b64d56dfc59082ba8805b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/t-chov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@08e1aba26bd18a2fbc0b64d56dfc59082ba8805b -
Trigger Event:
push
-
Statement type: