Skip to content

Commit

Permalink
Fix: Bugs with Sentry configuration (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman authored Jan 5, 2024
2 parents f6a09b8 + a33480e commit 2b2f5b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion eligibility_server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@

# use an app context for access to config settings
with app.app_context():
sentry.configure(config)
# configure root logger first, to prevent duplicate log entries from Flask's logger
logging.basicConfig(level=config.log_level, format=format_string)
# configure Flask's logger
app.logger.setLevel(config.log_level)
default_handler.formatter = logging.Formatter(format_string)
sentry.configure(config)
app.logger.info(f"Starting Eligibility Server {__version__}")


Expand Down
9 changes: 2 additions & 7 deletions eligibility_server/sentry.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import logging
import os
import subprocess

import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.scrubber import EventScrubber, DEFAULT_DENYLIST

from eligibility_server import __version__
from eligibility_server.settings import Configuration

logger = logging.getLogger(__name__)
Expand All @@ -14,13 +14,8 @@
SENTRY_ENVIRONMENT = os.environ.get("SENTRY_ENVIRONMENT", "local")


# https://stackoverflow.com/a/21901260/358804
def get_git_revision_hash():
return subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii").strip()


def get_release() -> str:
return get_git_revision_hash()
return __version__


def get_denylist():
Expand Down

0 comments on commit 2b2f5b8

Please sign in to comment.