Closed Bug 1748268 Opened 3 years ago Closed 3 years ago

`__heartbeat__` should send errors to sentry if it errors out

Categories

(Socorro :: Webapp, defect, P1)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: willkg)

References

Details

Attachments

(3 files)

Over the weekend, we had a bunch of HTTP 500s from the /__heartbeat__ endpoint, but there isn't anything in Sentry.

When the /__heartbeat__ endpoint errors out, it really should send something to Sentry indicating the problem.

Assignee: nobody → willkg
Status: NEW → ASSIGNED

The Socorro webapp doesn't have a /__broken__ endpoint, so I'm adding one. I need to add the infra bits first.

https://github.com/mozilla-services/cloudops-deployment/pull/4495

I added the /__broken__ endpoint and once that deployed to stage, I used it to trigger an HTTP 500. That part worked fine, however, nothing got sent to Sentry.

The webapp uses sentry-sdk and there's a bunch of sentry error sanitzation code that gets run before the errors get sent to Sentry. If the sanitization code errors out, it emits an webapp.sentry.before_send_exception incr. I looked that up and it looks like it's been erroring out for a while. However, since all it does is re-raise the exception that's getting thrown, I think that exception is getting swallowed and we never see it in the logs. I tweaked the sanitization exception handling code to log that exception and I'll see where that gets me.

That worked out nicely:

Uncaught exception:
  File "/app/webapp-django/crashstats/sentrylib.py", line 89, in __call__
    sanitizer(event, hint)
  File "/app/webapp-django/crashstats/sentrylib.py", line 137, in __call__
    crumb = crumb_sanitizer(crumb, {})
  File "/app/webapp-django/crashstats/sentrylib.py", line 171, in __call__
    if crumb.get("category") != "query" or not crumb.get("message"):
<class 'AttributeError'>
AttributeError("'str' object has no attribute 'get'")

I'll fix that and then theoretically sanitizing will work and then we're good to go again.

The last fix deployed to stage and I verified that errors are now getting reported to Sentry from the webapp in stage.

This was deployed an hour or so ago in bug #1748856. It should be fixed now.

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: