Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #284 from multinet-app/sentry
Browse files Browse the repository at this point in the history
Add sentry
  • Loading branch information
jjnesbitt committed Feb 4, 2020
2 parents 378f992 + c996afd commit dcfe750
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ FLASK_APP=multinet
FLASK_ENV=development

MYPYPATH=mypy_stubs

SENTRY_DSN=
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ recommonmark = "==0.5.0"
pre-commit = "==1.18.2"
flasgger = "*"
uwsgi = "*"
sentry-sdk = {extras = ["flask"],version = "==0.14.1"}

[requires]
python_version = "3.7"
Expand Down
37 changes: 27 additions & 10 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions multinet/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
"""Flask factory for Multinet app."""
import os
import sentry_sdk
from flask import Flask
from flask.logging import default_handler
from flask_cors import CORS
from flasgger import Swagger
from sentry_sdk.integrations.flask import FlaskIntegration

from typing import Optional, MutableMapping, Any, Tuple, Union

from multinet import api
from multinet import uploaders, downloaders
from multinet.errors import ServerError

sentry_dsn = os.getenv("SENTRY_DSN", default="")
sentry_sdk.init(dsn=sentry_dsn, integrations=[FlaskIntegration()])


def create_app(config: Optional[MutableMapping] = None) -> Flask:
"""Create a Multinet app instance."""
Expand Down

0 comments on commit dcfe750

Please sign in to comment.