Skip to content

Commit 621115e

Browse files
authored
Merge pull request #607 from alephdata/feature/disable-sentry-processing-exceptions
Introduce a setting to disable sending ProcessingExceptions to Sentry
2 parents a8da516 + dff0438 commit 621115e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

ingestors/manager.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ def ingest(self, file_path, entity, **kwargs):
219219
log.exception(f"[{repr(entity)}] Failed to process: {pexc}")
220220
INGESTIONS_FAILED.labels(ingestor=ingestor_name).inc()
221221
entity.set("processingError", stringify(pexc))
222-
capture_exception(pexc)
222+
if settings.SENTRY_CAPTURE_PROCESSING_EXCEPTIONS:
223+
capture_exception(pexc)
223224
finally:
224225
self.finalize(entity)
225226

ingestors/settings.py

+7
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,10 @@
5050

5151
# Also store cached values in the SQL database
5252
sls.TAGS_DATABASE_URI = fts.DATABASE_URI
53+
54+
# ProcessingException is thrown whenever something goes wrong wiht
55+
# parsing a file. Enable this with care, it can easily eat up the
56+
# Sentry quota of events.
57+
SENTRY_CAPTURE_PROCESSING_EXCEPTIONS = env.to_bool(
58+
"SENTRY_CAPTURE_PROCESSING_EXCEPTIONS", False
59+
)

0 commit comments

Comments
 (0)