Browse Source

ref(metrics): Add sentry.group.created with the platform tag. (#6436)

* ref(metrics): Add sentry.group.created with the platform tag.

* add a unknown tag when platform isn't supplied.

* use full metrics import path
James Cunningham 7 years ago
parent
commit
9849b2a43d
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/sentry/event_manager.py

+ 7 - 0
src/sentry/event_manager.py

@@ -37,6 +37,7 @@ from sentry.plugins import plugins
 from sentry.signals import first_event_received, regression_signal
 from sentry.tasks.merge import merge_group
 from sentry.tasks.post_process import post_process_group
+from sentry.utils import metrics
 from sentry.utils.cache import default_cache
 from sentry.utils.db import get_db_engine
 from sentry.utils.safe import safe_execute, trim, trim_dict
@@ -871,6 +872,12 @@ class EventManager(object):
                     **kwargs
                 ), True
 
+            metrics.incr(
+                'group.created',
+                skip_internal=True,
+                tags={'platform': event.platform or 'unknown'}
+            )
+
         else:
             group = Group.objects.get(id=existing_group_id)