Skip to main content

Sentry logging plugins for Metaflow (metaflow.org)

Project description

PyPI version

Sentry Logging Plugin for Metaflow

Enabling the use of Sentry with Metaflow

Installation

Install the plugin using pip.

pip install metaflow-sentry-logger

For development

pip install metaflow-sentry-logger[dev]

Usage

The sentry plugin can be called using either the --with sentry command line argument or through the step decorator @sentry.

Configuration

Only basic configuration is currently supported using environment variables.

Name Description Required Location
METAFLOW_SENTRY_DSN The DSN for the target sentry project True Environment Variable Metaflow Config
METAFLOW_PROFILE Used by this plugin to determine the environment. False Environment Variable

Examples

See the (examples)[examples] directory for some example flows or see the code snippets below

Using the step decorator

# examples/sample_flow.py 

from metaflow import FlowSpec, step, sentry


class MyFlow(FlowSpec):

    @step
    @sentry
    def start(self):
        print("Start step")

    @step
    @sentry
    def error(self):
        self.div_0 = 1/0

    @step
    @sentry
    def end(self):
        print("final step")

Calling using the --with command line argument

python examples/sample_flow_with.py run --with sentry

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-sentry-logger-0.2.1.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

metaflow_sentry_logger-0.2.1-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

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