Skip to content

Commit 062e5df

Browse files
authored
fix(post-process): remove some noisy logs (#70075)
these log literally tens of millions of times per hour and are not critical. lets save some money. added a metric to replace one of them. link to logs: https://cloudlogging.app.goo.gl/MGVM1k6F874pbjtn7
1 parent b33b16f commit 062e5df

File tree

2 files changed

+4
-35
lines changed

2 files changed

+4
-35
lines changed

src/sentry/tasks/post_process.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,6 @@ def handle_owner_assignment(job):
263263
)
264264

265265
if assignees_exists:
266-
logger.info(
267-
"handle_owner_assignment.assignee_exists",
268-
extra={
269-
**basic_logging_details,
270-
"reason": "assignee_exists",
271-
},
272-
)
273266
metrics.incr(
274267
"sentry.task.post_process.handle_owner_assignment.assignee_exists"
275268
)
@@ -282,13 +275,6 @@ def handle_owner_assignment(job):
282275
debounce_issue_owners = cache.get(issue_owners_key)
283276

284277
if debounce_issue_owners:
285-
logger.info(
286-
"handle_owner_assignment.issue_owners_exist",
287-
extra={
288-
**basic_logging_details,
289-
"reason": "issue_owners_exist",
290-
},
291-
)
292278
metrics.incr("sentry.tasks.post_process.handle_owner_assignment.debounce")
293279
return
294280

@@ -1454,15 +1440,7 @@ def detect_new_escalation(job: PostProcessJob):
14541440
or not has_valid_status
14551441
or times_seen < MIN_EVENTS_FOR_NEW_ESCALATION
14561442
):
1457-
logger.warning(
1458-
"tasks.post_process.detect_new_escalation.skipping_detection",
1459-
extra={
1460-
**extra,
1461-
"group_age_hours": group_age_hours,
1462-
"group_status": group.substatus,
1463-
"times_seen": times_seen,
1464-
},
1465-
)
1443+
metrics.incr("tasks.post_process.detect_new_escalation.skipping_detection")
14661444
return
14671445
# Get escalation lock for this group. If we're unable to acquire this lock, another process is handling
14681446
# this group at the same time. In that case, just exit early, no need to retry.

tests/sentry/tasks/test_post_process.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,8 +1311,8 @@ def test_auto_assignment_when_owners_are_invalid(self):
13111311
assert assignee is None
13121312
assert len(GroupOwner.objects.filter(group_id=event.group)) == 0
13131313

1314-
@patch("sentry.tasks.post_process.logger")
1315-
def test_debounces_handle_owner_assignments(self, logger):
1314+
@patch("sentry.utils.metrics.incr")
1315+
def test_debounces_handle_owner_assignments(self, mock_incr):
13161316
self.make_ownership()
13171317
event = self.create_event(
13181318
data={
@@ -1329,16 +1329,7 @@ def test_debounces_handle_owner_assignments(self, logger):
13291329
is_new_group_environment=False,
13301330
event=event,
13311331
)
1332-
logger.info.assert_any_call(
1333-
"handle_owner_assignment.issue_owners_exist",
1334-
extra={
1335-
"event": event.event_id,
1336-
"group": event.group_id,
1337-
"project": event.project_id,
1338-
"organization": event.project.organization_id,
1339-
"reason": "issue_owners_exist",
1340-
},
1341-
)
1332+
mock_incr.assert_any_call("sentry.tasks.post_process.handle_owner_assignment.debounce")
13421333

13431334
@patch("sentry.tasks.post_process.logger")
13441335
def test_issue_owners_should_ratelimit(self, mock_logger):

0 commit comments

Comments
 (0)