Browse Source

Record metrics for ignored events

David Cramer 10 years ago
parent
commit
b126380e67
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/sentry/utils/raven.py

+ 4 - 0
src/sentry/utils/raven.py

@@ -6,6 +6,8 @@ import logging
 from django.conf import settings
 from raven.contrib.django.client import DjangoClient
 
+from . import metrics
+
 UNSAFE_FILES = (
     'sentry/event_manager.py',
     'sentry/tasks/process_buffer.py',
@@ -31,6 +33,7 @@ class SentryInternalClient(DjangoClient):
 
     def capture(self, *args, **kwargs):
         if not can_record_current_event():
+            metrics.incr('internal.uncaptured.events')
             self.error_logger.error('Not capturing event due to unsafe stacktrace:\n%r', kwargs)
             return
         return super(SentryInternalClient, self).capture(*args, **kwargs)
@@ -55,4 +58,5 @@ class SentryInternalClient(DjangoClient):
 
 class SentryInternalFilter(logging.Filter):
     def filter(self, record):
+        metrics.incr('internal.uncaptured.logs')
         return not can_record_current_event()