Ejemplo n.º 1
0
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_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)
Ejemplo n.º 3
0
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)