Skip to main content

Add your description here

Project description

Metaflow Slack Notification Plugin

CI

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

  1. Create a new Slack App in your workspace
  2. Enable the following OAuth scopes:
    • chat:write
    • chat:write.public (if sending to public channels)
  3. Install the app to your workspace
  4. Copy the Bot User OAuth Token (starts with xoxb-)

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metaflow_slack_notifier-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metaflow_slack_notifier-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

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

Hashes for metaflow_slack_notifier-0.1.0.tar.gz
Algorithm Hash digest
SHA256 845a993232fabff667bfe2fa3b0cebe04a4380a4e5b063af319b4eac8792c21b
MD5 becfe08f9ee479b255239227a1956ce0
BLAKE2b-256 b2d2414b725feb4309b8f483d64a5adf7c36f112d5870d7c24692124ebaf8986

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaflow_slack_notifier-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for metaflow_slack_notifier-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e929ba43cf607041bd450a4f7fe8f3fa2d94b69f8720bf61563d254637519b0
MD5 d4abdf4f328c6ac23fb652153f07901d
BLAKE2b-256 12559a0546766e7ad219afecf02ad6892da3705254df44a85e03863ad4f32e82

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page