Skip to content

Commit 3567716

Browse files
committed
Removing Sentry
1 parent 2a415f3 commit 3567716

11 files changed

Lines changed: 7 additions & 45 deletions

File tree

.github/workflows/_deploy.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ jobs:
8686
environment-variables: |
8787
VERSION=${{ inputs.image-tag }}
8888
DD_VERSION=${{ inputs.image-tag }}
89-
SENTRY_RELEASE=${{ inputs.image-tag }}
9089
COMMIT_ID=${{ github.sha }}
9190
docker-labels: |
9291
com.datadoghq.tags.version=${{ inputs.image-tag }}

.github/workflows/_migrations.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ jobs:
5858
environment-variables: |
5959
VERSION=${{ inputs.image-tag }}
6060
DD_VERSION=${{ inputs.image-tag }}
61-
SENTRY_RELEASE=${{ inputs.image-tag }}
6261
docker-labels: |
6362
com.datadoghq.tags.version=${{ inputs.image-tag }}
6463

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ dependencies = [
3131
"python-multipart>=0.0.31",
3232
"python-slugify==8.0.4",
3333
"redis==5.2.*",
34-
"sentry-sdk~=2.13",
3534
"sqlalchemy[asyncio]~=1.4.53",
3635
"sqlalchemy-utils~=0.41.2",
3736
"structlog~=25.4.0",

src/apps/answers/service.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from typing import Callable, List, Mapping
1313

1414
import aiohttp
15-
import sentry_sdk
1615
from cryptography.hazmat.backends import default_backend
1716
from cryptography.hazmat.primitives import hashes
1817
from cryptography.hazmat.primitives.asymmetric import padding
@@ -1727,7 +1726,7 @@ async def _create_alerts(
17271726
).model_dump(),
17281727
)
17291728
except Exception as e:
1730-
sentry_sdk.capture_exception(e)
1729+
logger.exception(str(e))
17311730
break
17321731
await self.send_alert_mail(persons)
17331732

src/apps/answers/tasks.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import base64
22
import io
3-
import traceback
43
import uuid
54

6-
import sentry_sdk
75
from fastapi import UploadFile
86
from sqlalchemy.ext.asyncio import AsyncSession
97

@@ -13,6 +11,7 @@
1311
from apps.mailing.services import MailingService
1412
from broker import broker
1513
from infrastructure.database import session_manager
14+
from infrastructure.logger import logger
1615

1716
# moved from previous implementation
1817

@@ -64,5 +63,4 @@ async def create_report(
6463
)
6564
)
6665
except Exception as e:
67-
traceback.print_exception(e)
68-
sentry_sdk.capture_exception(e)
66+
logger.exception(str(e))

src/apps/integrations/loris/service/loris.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from collections import defaultdict
88

99
import aiohttp
10-
import sentry_sdk
1110
from pydantic.json import pydantic_encoder
1211

1312
from apps.activities.crud.activity_history import ActivityHistoriesCRUD
@@ -890,7 +889,7 @@ async def _create_integration_alerts(self, applet_id: uuid.UUID, message: str):
890889
)
891890

892891
except Exception as e:
893-
sentry_sdk.capture_exception(e)
892+
logger.exception(str(e))
894893
break
895894

896895
async def create_loris_integration(self, hostname, username, project, password) -> LorisIntegration:

src/config/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
from config.rabbitmq import RabbitMQSettings
2424
from config.redis import RedisSettings
2525
from config.secret import SecretSettings
26-
from config.sentry import SentrySettings
2726
from config.service import JsonLdConverterSettings, ServiceSettings
2827
from config.superuser import SuperAdmin
2928
from config.task import AnswerEncryption, AudioFileConvert, ImageConvert
@@ -71,9 +70,6 @@ class Settings(BaseSettings):
7170
# CDN configs
7271
cdn: CDNSettings = CDNSettings()
7372

74-
# Sentry stuff
75-
sentry: SentrySettings = SentrySettings()
76-
7773
# FCM Notification configs
7874
fcm: FirebaseCloudMessagingSettings = FirebaseCloudMessagingSettings()
7975

src/config/sentry.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/infrastructure/app.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import Iterable, Type
22

3-
import sentry_sdk
43
from asgi_correlation_id import CorrelationIdMiddleware
54
from asyncpg import InvalidPasswordError
65
from fastapi import FastAPI
@@ -111,9 +110,6 @@ def create_app():
111110
lifespan=lifespan,
112111
)
113112

114-
if settings.sentry.dsn:
115-
sentry_sdk.init(dsn=settings.sentry.dsn, traces_sample_rate=1.0)
116-
117113
# Include routers
118114
for router in routers:
119115
app.include_router(router)

src/infrastructure/utility/redis_client.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
import redis.asyncio as redis
77
from redis.typing import EncodableT
8-
from sentry_sdk import capture_exception
98

109
from config import settings
10+
from infrastructure.logger import logger
1111

1212

1313
class RedisCacheTest:
@@ -139,11 +139,8 @@ def _start(self):
139139
db=self.db,
140140
**self.configuration,
141141
)
142-
except redis.exceptions.ConnectionError as e:
143-
try:
144-
capture_exception(e)
145-
except ImportError:
146-
print(e)
142+
except redis.ConnectionError as e:
143+
logger.exception(str(e))
147144

148145
async def get(self, key: str) -> typing.Optional[str]:
149146
if not self._cache:

0 commit comments

Comments
 (0)