Enabling the use of Sentry with Metaflow
This repo relies on the unsupported extensions API and was built against metaflow==2.7.18. The extensions API was changed in metaflow==2.7.20
Install the plugin using pip.
pip install metaflow-sentry-logger
For development
pip install metaflow-sentry-logger[dev]
The sentry plugin can be called using either the --with sentry
command line argument or through the step decorator @sentry
.
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 |
See the (examples)[examples] directory for some example flows or see the code snippets below
# 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")
python examples/sample_flow_with.py run --with sentry