diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-12-15 16:33:57 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-12-15 16:33:57 -0800 |
commit | ec5fe122505396613812993547a8897d4904b2ee (patch) | |
tree | 34fa8d6a60785f2b23dc02e06118cec8a5abde0e /python | |
parent | a3719d6501e4b7cc520ba05264d99bdcc2d7bed7 (diff) | |
download | sandcrawler-ec5fe122505396613812993547a8897d4904b2ee.tar.gz sandcrawler-ec5fe122505396613812993547a8897d4904b2ee.zip |
ingest tool: allow enabling sentry (for exception debugging)
Diffstat (limited to 'python')
-rwxr-xr-x | python/ingest_tool.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/python/ingest_tool.py b/python/ingest_tool.py index 1843e0b..c0599d7 100755 --- a/python/ingest_tool.py +++ b/python/ingest_tool.py @@ -5,6 +5,8 @@ import json import sys from http.server import HTTPServer +import raven + from sandcrawler import GrobidClient, JsonLinePusher, KafkaCompressSink, KafkaSink from sandcrawler.ingest_file import IngestFileRequestHandler, IngestFileWorker from sandcrawler.ingest_fileset import IngestFilesetWorker @@ -41,6 +43,12 @@ def run_single_ingest(args): def run_requests(args): + if args.enable_sentry: + try: + git_sha = raven.fetch_git_sha("..") + except Exception: + git_sha = None + sentry_client = raven.Client(release=git_sha) # TODO: switch to using JsonLinePusher file_worker = IngestFileWorker( try_spn2=not args.no_spn2, @@ -154,6 +162,11 @@ def main(): sub_requests.add_argument( "--no-spn2", action="store_true", help="don't use live web (SPNv2)" ) + parser.add_argument( + "--enable-sentry", + action="store_true", + help="report exceptions to Sentry", + ) sub_requests.add_argument( "--html-quick-mode", action="store_true", |