def record_sourcemaps_received(project, event, **kwargs): if not has_sourcemap(event): return success = OrganizationOnboardingTask.objects.record( organization_id=project.organization_id, task=OnboardingTask.SOURCEMAPS, status=OnboardingTaskStatus.COMPLETE, project_id=project.id, ) if success: try: user = Organization.objects.get( id=project.organization_id).get_default_owner() except IndexError: logging.getLogger("sentry").warn( "Cannot record sourcemaps received for organization (%s) due to missing owners", project.organization_id, ) return analytics.record( "first_sourcemaps.sent", user_id=user.id, organization_id=project.organization_id, project_id=project.id, ) try_mark_onboarding_complete(project.organization_id)
def record_sourcemaps_received(project, group, event, **kwargs): if has_sourcemap(event): try: with transaction.atomic(): OrganizationOnboardingTask.objects.create( organization=project.organization, task=OnboardingTask.SOURCEMAPS, status=OnboardingTaskStatus.COMPLETE, project_id=project.id, date_completed=timezone.now()) except IntegrityError: pass
def record_sourcemaps_received(project, group, event, **kwargs): if not has_sourcemap(event): return success = OrganizationOnboardingTask.objects.record( organization_id=project.organization_id, task=OnboardingTask.SOURCEMAPS, status=OnboardingTaskStatus.COMPLETE, project_id=project.id, ) if success: check_for_onboarding_complete(project.organization_id)
def record_sourcemaps_received(project, group, event, **kwargs): if not has_sourcemap(event): return success = OrganizationOnboardingTask.objects.record( organization_id=project.organization_id, task=OnboardingTask.SOURCEMAPS, status=OnboardingTaskStatus.COMPLETE, project_id=project.id, ) if success: check_for_onboarding_complete(project.organization_id)
def record_sourcemaps_received(project, group, event, **kwargs): if has_sourcemap(event): try: with transaction.atomic(): OrganizationOnboardingTask.objects.create( organization=project.organization, task=OnboardingTask.SOURCEMAPS, status=OnboardingTaskStatus.COMPLETE, project_id=project.id, date_completed=timezone.now() ) except IntegrityError: pass
def record_event_processed(project, event, **kwargs): feature_slugs = [] platform = event.group.platform if event.group else event.platform # Platform if platform in manager.location_slugs("language"): feature_slugs.append(platform) # Release Tracking if event.get_tag("sentry:release"): feature_slugs.append("release_tracking") # Environment Tracking if event.get_tag("environment"): feature_slugs.append("environment_tracking") # User Tracking user_context = event.data.get("user") # We'd like them to tag with id or email. # Certain SDKs automatically tag with ip address. # Check to make sure more the ip address is being sent. # testing for this in test_no_user_tracking_for_ip_address_only # list(d.keys()) pattern is to make this python3 safe if user_context and list(user_context.keys()) != ["ip_address"]: feature_slugs.append("user_tracking") # Custom Tags if {tag[0] for tag in event.tags} - DEFAULT_TAGS: feature_slugs.append("custom_tags") # Sourcemaps if has_sourcemap(event): feature_slugs.append("source_maps") # Breadcrumbs if event.data.get("breadcrumbs"): feature_slugs.append("breadcrumbs") if not feature_slugs: return FeatureAdoption.objects.bulk_record(project.organization_id, feature_slugs)
def record_sourcemaps_received(project, event, **kwargs): if not has_sourcemap(event): return success = OrganizationOnboardingTask.objects.record( organization_id=project.organization_id, task=OnboardingTask.SOURCEMAPS, status=OnboardingTaskStatus.COMPLETE, project_id=project.id, ) if success: user = Organization.objects.get(id=project.organization_id).get_default_owner() analytics.record( "first_sourcemaps.sent", user_id=user.id, organization_id=project.organization_id, project_id=project.id, ) check_for_onboarding_complete(project.organization_id)
def record_sourcemaps_received(project, group, event, **kwargs): if not has_sourcemap(event): return success = OrganizationOnboardingTask.objects.record( organization_id=project.organization_id, task=OnboardingTask.SOURCEMAPS, status=OnboardingTaskStatus.COMPLETE, project_id=project.id, ) if success: user = Organization.objects.get(id=project.organization_id).get_default_owner() analytics.record( 'first_sourcemaps.sent', user_id=user.id, organization_id=project.organization_id, project_id=project.id, ) check_for_onboarding_complete(project.organization_id)
def record_event_processed(project, group, event, **kwargs): feature_slugs = [] # Platform if group.platform in manager.location_slugs('language'): feature_slugs.append(group.platform) # Release Tracking if event.get_tag('sentry:release'): feature_slugs.append('release_tracking') # Environment Tracking if event.get_tag('environment'): feature_slugs.append('environment_tracking') # User Tracking user_context = event.data.get('sentry.interfaces.User') # We'd like them to tag with id or email. # Certain SDKs automatically tag with ip address. # Check to make sure more the ip address is being sent. # testing for this in test_no_user_tracking_for_ip_address_only # list(d.keys()) pattern is to make this python3 safe if user_context and list(user_context.keys()) != ['ip_address']: feature_slugs.append('user_tracking') # Custom Tags if set(tag[0] for tag in event.tags) - DEFAULT_TAGS: feature_slugs.append('custom_tags') # Sourcemaps if has_sourcemap(event): feature_slugs.append('source_maps') # Breadcrumbs if event.data.get('sentry.interfaces.Breadcrumbs'): feature_slugs.append('breadcrumbs') if not feature_slugs: return FeatureAdoption.objects.bulk_record(project.organization_id, feature_slugs)
def record_event_processed(project, group, event, **kwargs): feature_slugs = [] # Platform if group.platform in manager.location_slugs('language'): feature_slugs.append(group.platform) # Release Tracking if event.get_tag('sentry:release'): feature_slugs.append('release_tracking') # Environment Tracking if event.get_tag('environment'): feature_slugs.append('environment_tracking') # User Tracking user_context = event.data.get('sentry.interfaces.User') # We'd like them to tag with id or email. # Certain SDKs automatically tag with ip address. # Check to make sure more the ip address is being sent. # testing for this in test_no_user_tracking_for_ip_address_only # list(d.keys()) pattern is to make this python3 safe if user_context and list(user_context.keys()) != ['ip_address']: feature_slugs.append('user_tracking') # Custom Tags if set(tag[0] for tag in event.tags) - DEFAULT_TAGS: feature_slugs.append('custom_tags') # Sourcemaps if has_sourcemap(event): feature_slugs.append('source_maps') # Breadcrumbs if event.data.get('sentry.interfaces.Breadcrumbs'): feature_slugs.append('breadcrumbs') if not feature_slugs: return FeatureAdoption.objects.bulk_record(project.organization_id, feature_slugs)