Skip to content

Commit

Permalink
add sentry as requirement for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
DGaffney committed Sep 5, 2023
1 parent 6511cbd commit d5bf172
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from lib.queue.worker import QueueWorker
from lib.logger import logger
from lib import schemas
from lib.sentry import sentry_sdk

app = FastAPI()

Expand Down
9 changes: 9 additions & 0 deletions lib/sentry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os
import sentry_sdk
from lib.helpers import get_environment_setting

sentry_sdk.init(
dsn=get_environment_setting('sentry_sdk_dsn'),
environment=get_environment_setting("DEPLOY_ENV"),
traces_sample_rate=1.0,
)
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ httpx==0.23.1
huggingface-hub==0.11.0
fasttext==0.9.2
requests==2.31.0
pytest==7.4.0
pytest==7.4.0
sentry-sdk==1.30.0
1 change: 1 addition & 0 deletions run_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from lib.queue.processor import QueueProcessor
from lib.model.model import Model
from lib.logger import logger
from lib.sentry import sentry_sdk
queue = QueueProcessor.create()

logger.info("Beginning callback loop...")
Expand Down
1 change: 1 addition & 0 deletions run_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from lib.queue.worker import QueueWorker
from lib.model.model import Model
from lib.logger import logger
from lib.sentry import sentry_sdk
queue = QueueWorker.create()

model = Model.create()
Expand Down

0 comments on commit d5bf172

Please sign in to comment.