Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Dumps: Add Sentry error logging #6319

Merged
merged 6 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions conf/openlibrary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,11 @@ sentry:
dsn: 'https://[email protected]/0'
environment: 'local'

sentry_cron_jobs:
enabled: false
# Dummy endpoint; where sentry logs are sent to
dsn: 'https://[email protected]/0'
environment: 'local'

# Observations cache settings:
observation_cache_duration: 86400
7 changes: 7 additions & 0 deletions openlibrary/data/dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@

import web

from infogami import config
from infogami.infobase.utils import flatten_dict
from openlibrary.data import db
from openlibrary.data.sitemap import generate_html_index, generate_sitemaps
from openlibrary.plugins.openlibrary.processors import urlsafe
from openlibrary.utils.sentry import Sentry

logger = logging.getLogger(__file__)
logger.setLevel(logging.DEBUG)
Expand Down Expand Up @@ -372,4 +374,9 @@ def main(cmd, args):


if __name__ == "__main__":
sentry = Sentry(getattr(config, 'sentry', {}))
cclauss marked this conversation as resolved.
Show resolved Hide resolved
if sentry.enabled:
sentry.init()
division_by_zero = 1 / 0 # TODO (cclauss): Remove this line!!

main(sys.argv[1], sys.argv[2:])