metaflow-sentry-logger


Namemetaflow-sentry-logger JSON
Version 0.2.1 PyPI version JSON
download
home_page
SummarySentry logging plugins for Metaflow (metaflow.org)
upload_time2023-01-31 22:51:40
maintainer
docs_urlNone
authorRichard Smith
requires_python>=3.7
license
keywords metaflow
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI version](https://badge.fury.io/py/metaflow-sentry-logger.svg)](https://badge.fury.io/py/metaflow-sentry-logger)

# Sentry Logging Plugin for Metaflow

Enabling the use of [Sentry](https://sentry.io/) with [Metaflow](https://metaflow.org/)


- [Sentry Logging Plugin for Metaflow](#sentry-logging-plugin-for-metaflow)
  - [Installation](#installation)
  - [Usage](#usage)
  - [Configuration](#configuration)
  - [Examples](#examples)
    - [Using the step decorator](#using-the-step-decorator)
    - [Calling using the `--with` command line argument](#calling-using-the---with-command-line-argument)

## Installation

Install the plugin using pip.

```bash
pip install metaflow-sentry-logger
```

For development 

```bash
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

```python
# 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

```bash
python examples/sample_flow_with.py run --with sentry
```



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "metaflow-sentry-logger",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "metaflow",
    "author": "Richard Smith",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/b8/57/f03052a0af7ec7ed0d3af72b14897919211fa04577501065ba03a288ae61/metaflow-sentry-logger-0.2.1.tar.gz",
    "platform": null,
    "description": "[![PyPI version](https://badge.fury.io/py/metaflow-sentry-logger.svg)](https://badge.fury.io/py/metaflow-sentry-logger)\n\n# Sentry Logging Plugin for Metaflow\n\nEnabling the use of [Sentry](https://sentry.io/) with [Metaflow](https://metaflow.org/)\n\n\n- [Sentry Logging Plugin for Metaflow](#sentry-logging-plugin-for-metaflow)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [Configuration](#configuration)\n  - [Examples](#examples)\n    - [Using the step decorator](#using-the-step-decorator)\n    - [Calling using the `--with` command line argument](#calling-using-the---with-command-line-argument)\n\n## Installation\n\nInstall the plugin using pip.\n\n```bash\npip install metaflow-sentry-logger\n```\n\nFor development \n\n```bash\npip install metaflow-sentry-logger[dev]\n```\n\n## Usage\n\nThe sentry plugin can be called using either the `--with sentry` command line argument or through the step decorator `@sentry`.\n\n## Configuration\n\nOnly basic configuration is currently supported using environment variables.\n\n| Name                  | Description                                       | Required | Location                                 |\n| --------------------- | ------------------------------------------------- | -------- | ---------------------------------------- |\n| `METAFLOW_SENTRY_DSN` | The DSN for the target sentry project             | `True`   | `Environment Variable` `Metaflow Config` |\n| `METAFLOW_PROFILE`    | Used by this plugin to determine the environment. | `False`  | `Environment Variable`                   |\n\n## Examples\n\nSee the (examples)[examples] directory for some example flows or see the code snippets below\n\n### Using the step decorator\n\n```python\n# examples/sample_flow.py \n\nfrom metaflow import FlowSpec, step, sentry\n\n\nclass MyFlow(FlowSpec):\n\n    @step\n    @sentry\n    def start(self):\n        print(\"Start step\")\n\n    @step\n    @sentry\n    def error(self):\n        self.div_0 = 1/0\n\n    @step\n    @sentry\n    def end(self):\n        print(\"final step\")\n```\n\n### Calling using the `--with` command line argument\n\n```bash\npython examples/sample_flow_with.py run --with sentry\n```\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Sentry logging plugins for Metaflow (metaflow.org)",
    "version": "0.2.1",
    "split_keywords": [
        "metaflow"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "baca4c0d32706ef1100713b6a70f6d01a907e14655ba8931598fa53f3f29f6a3",
                "md5": "b53b40b012f27f061115621665de3204",
                "sha256": "e148617b996e6ff682af90a486d52b86c595404056c1a6f66e08f23561bc2e2c"
            },
            "downloads": -1,
            "filename": "metaflow_sentry_logger-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b53b40b012f27f061115621665de3204",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 4845,
            "upload_time": "2023-01-31T22:51:39",
            "upload_time_iso_8601": "2023-01-31T22:51:39.392684Z",
            "url": "https://files.pythonhosted.org/packages/ba/ca/4c0d32706ef1100713b6a70f6d01a907e14655ba8931598fa53f3f29f6a3/metaflow_sentry_logger-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b857f03052a0af7ec7ed0d3af72b14897919211fa04577501065ba03a288ae61",
                "md5": "3c0fbc7348ba856064daf99b750c6126",
                "sha256": "10f1d5bb26e95a1423968adc8a8ec1ea9f0b839463e223a07574735b059d1572"
            },
            "downloads": -1,
            "filename": "metaflow-sentry-logger-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3c0fbc7348ba856064daf99b750c6126",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 3476,
            "upload_time": "2023-01-31T22:51:40",
            "upload_time_iso_8601": "2023-01-31T22:51:40.408840Z",
            "url": "https://files.pythonhosted.org/packages/b8/57/f03052a0af7ec7ed0d3af72b14897919211fa04577501065ba03a288ae61/metaflow-sentry-logger-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-31 22:51:40",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "metaflow-sentry-logger"
}
        
Elapsed time: 0.03865s