Skip to content

Commit

Permalink
Merge pull request #814 from AlmaLinux/fix-sentry-false-positive
Browse files Browse the repository at this point in the history
Fix Sentry constantly reporting errors when there are none
  • Loading branch information
Korulag authored May 2, 2024
2 parents e135498 + 886482c commit fa993f7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions alws/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import sentry_sdk
from fastapi import FastAPI
from pika.exceptions import StreamLostError
from starlette.middleware.exceptions import ExceptionMiddleware

from alws import routers
Expand All @@ -29,6 +30,10 @@
dsn=settings.sentry_dsn,
traces_sample_rate=settings.sentry_traces_sample_rate,
environment=settings.sentry_environment,
ignore_errors=[
ConnectionResetError,
StreamLostError,
],
)


Expand Down
2 changes: 1 addition & 1 deletion alws/schemas/build_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ async def get_module_data_from_beholder(
try:
beholder_response = await beholder_client.get(endpoint)
except Exception:
logging.error('Cannot get module info')
logging.warning('Cannot get module info')
return result
result['devel'] = devel
result['arch'] = arch
Expand Down
2 changes: 1 addition & 1 deletion alws/utils/beholder_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def iter_endpoints(
coro = self.post(endpoint, data)
yield await coro
except Exception:
logging.error(
logging.warning(
"Cannot retrieve beholder info, "
"trying next reference platform"
)
Expand Down

0 comments on commit fa993f7

Please sign in to comment.