Add sentry integration

This commit is contained in:
Jake Howard 2019-02-17 17:14:17 +00:00
parent 009ad478c9
commit a76a1299d3
Signed by: jake
GPG key ID: 57AFB45680EDD477
4 changed files with 18 additions and 2 deletions

View file

@ -30,3 +30,4 @@ apscheduler = "*"
pygithub = "*" pygithub = "*"
aiohttp-basicauth = "*" aiohttp-basicauth = "*"
todoist-python = "*" todoist-python = "*"
sentry-sdk = "*"

10
Pipfile.lock generated
View file

@ -1,7 +1,7 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "e5bae820f6ea756ef53964fdbca323eef372e2d55902e2b023fc3e8d56f88ad1" "sha256": "02a1333dca8ccc32369c019b489cb122508593d04aa84af2526779b75d6ce89a"
}, },
"pipfile-spec": 6, "pipfile-spec": 6,
"requires": { "requires": {
@ -170,6 +170,14 @@
], ],
"version": "==2.21.0" "version": "==2.21.0"
}, },
"sentry-sdk": {
"hashes": [
"sha256:131e3b9ac11dffd86fe4f1f5d388d3dab372fc9e30d6611d1fc87096a1d67359",
"sha256:e925a2363178c211ad787f507cedda12ee5b0aadf5ac390950140393636a80bb"
],
"index": "pypi",
"version": "==0.7.2"
},
"six": { "six": {
"hashes": [ "hashes": [
"sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c",

View file

@ -1,16 +1,21 @@
import logging import logging
from multiprocessing import Process from multiprocessing import Process
import sentry_sdk
from aiohttp.web import run_app as run_web_app from aiohttp.web import run_app as run_web_app
from actioner.scheduler import create_scheduler, start_scheduler 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 from actioner.web import get_server
def main(): def main():
logging.basicConfig(level=LOGGING_LEVEL) logging.basicConfig(level=LOGGING_LEVEL)
sentry_sdk.init(
dsn=SENTRY_DSN,
)
server = get_server() server = get_server()
scheduler = create_scheduler() scheduler = create_scheduler()

View file

@ -5,6 +5,8 @@ GITHUB_TOKEN = os.environ['GITHUB_TOKEN']
TODOIST_TOKEN = os.environ['TODOIST_TOKEN'] TODOIST_TOKEN = os.environ['TODOIST_TOKEN']
SENTRY_DSN = os.environ.get('SENTRY_DSN', '')
LOGGING_LEVEL = _nameToLevel[os.environ.get('LOGGING_LEVEL', 'INFO')] LOGGING_LEVEL = _nameToLevel[os.environ.get('LOGGING_LEVEL', 'INFO')]
BASIC_AUTH = os.environ['BASIC_AUTH'].split(":") BASIC_AUTH = os.environ['BASIC_AUTH'].split(":")