Skip to content

Commit 85bf7e1

Browse files
authored
Remove rollbar (#1087)
1 parent c2d0a5a commit 85bf7e1

File tree

4 files changed

+1
-50
lines changed

4 files changed

+1
-50
lines changed

inbox/api/err.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class AccountDoesNotExistError(APIException):
7070

7171

7272
def err(http_code, message, **kwargs): # type: ignore[no-untyped-def] # noqa: ANN201
73-
"""Handle unexpected errors, including sending the traceback to Rollbar."""
73+
"""Handle unexpected errors."""
7474
log.exception("API error", user_error_message=message, **kwargs)
7575
resp = {"type": "api_error", "message": message}
7676
resp.update(kwargs)

inbox/error_handling.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,16 @@
1-
import json
21
import logging
32
import os
43

5-
import rollbar # type: ignore[import-untyped]
64
import sentry_sdk
75
import sentry_sdk.integrations.logging
86
import sentry_sdk.scrubber
9-
from rollbar.logger import RollbarHandler # type: ignore[import-untyped]
107

118
from inbox.constants import ERROR_REPORTING_SCRUB_FIELDS
129
from inbox.logging import get_logger
1310

1411
log = get_logger()
1512

1613
SENTRY_DSN = os.getenv("SENTRY_DSN", "")
17-
ROLLBAR_API_KEY = os.getenv("ROLLBAR_API_KEY", "")
18-
19-
20-
class SyncEngineRollbarHandler(RollbarHandler):
21-
def emit(self, record): # type: ignore[no-untyped-def] # noqa: ANN201
22-
try:
23-
data = json.loads(record.msg)
24-
except ValueError:
25-
return super().emit(record)
26-
27-
event = data.get("event")
28-
record.payload_data = {"fingerprint": event, "title": event}
29-
30-
return super().emit(record)
3114

3215

3316
GROUP_EXCEPTION_CLASSES = [
@@ -62,35 +45,9 @@ def payload_handler(payload, **kw): # type: ignore[no-untyped-def] # noqa: ANN
6245

6346

6447
def maybe_enable_error_reporting() -> None:
65-
maybe_enable_rollbar()
6648
maybe_enable_sentry()
6749

6850

69-
def maybe_enable_rollbar() -> None:
70-
if not ROLLBAR_API_KEY:
71-
log.info("ROLLBAR_API_KEY not configured - Rollbar disabled.")
72-
return
73-
74-
application_environment = (
75-
"production" if os.getenv("NYLAS_ENV", "") == "prod" else "dev"
76-
)
77-
78-
rollbar.init(
79-
ROLLBAR_API_KEY,
80-
application_environment,
81-
allow_logging_basic_config=False,
82-
)
83-
84-
rollbar_handler = SyncEngineRollbarHandler()
85-
rollbar_handler.setLevel(logging.ERROR)
86-
logger = logging.getLogger()
87-
logger.addHandler(rollbar_handler)
88-
89-
rollbar.events.add_payload_handler(payload_handler)
90-
91-
log.info("Rollbar enabled")
92-
93-
9451
def maybe_enable_sentry() -> None:
9552
if not SENTRY_DSN:
9653
log.info("SENTRY_DSN not configured - Sentry disabled.")

requirements/requirements-prod.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ redis==5.0.2
7272
regex==2021.11.10
7373
requests==2.32.4
7474
requests-file==1.5.1
75-
rollbar==0.16.2
7675
s3transfer==0.10.3
7776
sentry-sdk<3
7877
setproctitle==1.2.2

requirements/requirements-prod.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -984,17 +984,13 @@ requests==2.32.4 \
984984
# -r requirements-prod.in
985985
# authalligator-client
986986
# requests-file
987-
# rollbar
988987
# tldextract
989988
requests-file==1.5.1 \
990989
--hash=sha256:07d74208d3389d01c38ab89ef403af0cfec63957d53a0081d8eca738d0247d8e \
991990
--hash=sha256:dfe5dae75c12481f68ba353183c53a65e6044c923e64c24b2209f6c7570ca953
992991
# via
993992
# -r requirements-prod.in
994993
# tldextract
995-
rollbar==0.16.2 \
996-
--hash=sha256:aa3b570062dd8dfb0e11537ba858f9e1633a604680e062a525434b8245540f87
997-
# via -r requirements-prod.in
998994
s3transfer==0.10.3 \
999995
--hash=sha256:263ed587a5803c6c708d3ce44dc4dfedaab4c1a32e8329bab818933d79ddcf5d \
1000996
--hash=sha256:4f50ed74ab84d474ce614475e0b8d5047ff080810aac5d01ea25231cfc944b0c
@@ -1039,7 +1035,6 @@ six==1.16.0 \
10391035
# imapclient
10401036
# python-dateutil
10411037
# requests-file
1042-
# rollbar
10431038
sqlalchemy==1.4.54 \
10441039
--hash=sha256:02d2ecb9508f16ab9c5af466dfe5a88e26adf2e1a8d1c56eb616396ccae2c186 \
10451040
--hash=sha256:0b76bbb1cbae618d10679be8966f6d66c94f301cfc15cb49e2f2382563fb6efb \

0 commit comments

Comments
 (0)