From a76a1299d39cf0e1c9474c51a8b8407364bd6699 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 17 Feb 2019 17:14:17 +0000 Subject: [PATCH] Add sentry integration --- Pipfile | 1 + Pipfile.lock | 10 +++++++++- actioner/main.py | 7 ++++++- actioner/settings.py | 2 ++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index b78db39..3fc4516 100644 --- a/Pipfile +++ b/Pipfile @@ -30,3 +30,4 @@ apscheduler = "*" pygithub = "*" aiohttp-basicauth = "*" todoist-python = "*" +sentry-sdk = "*" diff --git a/Pipfile.lock b/Pipfile.lock index f057514..b6b1b31 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "e5bae820f6ea756ef53964fdbca323eef372e2d55902e2b023fc3e8d56f88ad1" + "sha256": "02a1333dca8ccc32369c019b489cb122508593d04aa84af2526779b75d6ce89a" }, "pipfile-spec": 6, "requires": { @@ -170,6 +170,14 @@ ], "version": "==2.21.0" }, + "sentry-sdk": { + "hashes": [ + "sha256:131e3b9ac11dffd86fe4f1f5d388d3dab372fc9e30d6611d1fc87096a1d67359", + "sha256:e925a2363178c211ad787f507cedda12ee5b0aadf5ac390950140393636a80bb" + ], + "index": "pypi", + "version": "==0.7.2" + }, "six": { "hashes": [ "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", diff --git a/actioner/main.py b/actioner/main.py index 9103ae0..aee7bfb 100644 --- a/actioner/main.py +++ b/actioner/main.py @@ -1,16 +1,21 @@ import logging from multiprocessing import Process +import sentry_sdk from aiohttp.web import run_app as run_web_app from actioner.scheduler import create_scheduler, start_scheduler -from actioner.settings import LOGGING_LEVEL +from actioner.settings import LOGGING_LEVEL, SENTRY_DSN from actioner.web import get_server def main(): logging.basicConfig(level=LOGGING_LEVEL) + sentry_sdk.init( + dsn=SENTRY_DSN, + ) + server = get_server() scheduler = create_scheduler() diff --git a/actioner/settings.py b/actioner/settings.py index 4c26106..f890876 100644 --- a/actioner/settings.py +++ b/actioner/settings.py @@ -5,6 +5,8 @@ GITHUB_TOKEN = os.environ['GITHUB_TOKEN'] TODOIST_TOKEN = os.environ['TODOIST_TOKEN'] +SENTRY_DSN = os.environ.get('SENTRY_DSN', '') + LOGGING_LEVEL = _nameToLevel[os.environ.get('LOGGING_LEVEL', 'INFO')] BASIC_AUTH = os.environ['BASIC_AUTH'].split(":")