aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-12-15 16:33:57 -0800
committerBryan Newbold <bnewbold@archive.org>2021-12-15 16:33:57 -0800
commitec5fe122505396613812993547a8897d4904b2ee (patch)
tree34fa8d6a60785f2b23dc02e06118cec8a5abde0e /python
parenta3719d6501e4b7cc520ba05264d99bdcc2d7bed7 (diff)
downloadsandcrawler-ec5fe122505396613812993547a8897d4904b2ee.tar.gz
sandcrawler-ec5fe122505396613812993547a8897d4904b2ee.zip
ingest tool: allow enabling sentry (for exception debugging)
Diffstat (limited to 'python')
-rwxr-xr-xpython/ingest_tool.py13
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",