fix(sentry): Add sentry filtering stop gap (#3185)
This commit is contained in:
@@ -160,6 +160,17 @@ async def lifespan(app_: FastAPI):
|
||||
logger.info(f"[Worker {worker_id}] Lifespan shutdown completed")
|
||||
|
||||
|
||||
# TODO: Make this more robust
|
||||
def filter_out_sentry_errors(event, hint):
|
||||
if (
|
||||
"Fiel processing Failed" in str(event.get("exception"))
|
||||
or "Failed to embed batch of size 32" in str(event.get("exception"))
|
||||
or "`inputs` must have less than 512 tokens" in str(event.get("exception"))
|
||||
):
|
||||
return None
|
||||
return event
|
||||
|
||||
|
||||
def create_application() -> "FastAPI":
|
||||
"""the application start routine"""
|
||||
# global server
|
||||
@@ -175,6 +186,7 @@ def create_application() -> "FastAPI":
|
||||
_experiments={
|
||||
"continuous_profiling_auto_start": True,
|
||||
},
|
||||
before_send=filter_out_sentry_errors,
|
||||
)
|
||||
|
||||
debug_mode = "--debug" in sys.argv
|
||||
|
||||
Reference in New Issue
Block a user