def get_array_field(self, field):
     pattern = r"^(error|stack)\..+"
     term = re.search(pattern, field)
     if term and SENTRY_SNUBA_MAP.get(field):
         return term
     return None
示例#2
0
 def get_array_field(self, field):
     pattern = r"^(error|stack)\..+"
     term = re.search(pattern, field)
     if term and SENTRY_SNUBA_MAP.get(field):
         return term
     return None
示例#3
0
from __future__ import absolute_import

from collections import OrderedDict
from copy import deepcopy

from sentry import tagstore
from sentry.models import Project
from sentry.tagstore.types import TagKey, TagValue
from sentry.tagstore.base import TOP_VALUES_DEFAULT_LIMIT
from sentry.utils.snuba import (
    raw_query,
    SENTRY_SNUBA_MAP,
)

NON_TAG_KEYS = SENTRY_SNUBA_MAP.copy()
NON_TAG_KEYS.update({'project.name': 'project_id'})


def lookup_tags(keys, **snuba_args):
    tag_keys = []
    non_tag_keys = []

    for key in keys:
        if key in NON_TAG_KEYS:
            non_tag_keys.append(key)
        else:
            tag_keys.append(tagstore.prefix_reserved_key(key))

    if tag_keys:
        top_values = get_top_values(keys=tag_keys, **snuba_args)
    else: