Skip to content

Commit

Permalink
feat(rpc): Remove spans specific code (#83714)
Browse files Browse the repository at this point in the history
- Removes spans specific code from the SearchResolver so that it can be
reused by logs
  • Loading branch information
wmak authored Jan 21, 2025
1 parent 593326a commit 0e89a6d
Show file tree
Hide file tree
Showing 7 changed files with 659 additions and 544 deletions.
12 changes: 8 additions & 4 deletions src/sentry/api/endpoints/organization_spans_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
from sentry.api.utils import handle_query_errors
from sentry.models.organization import Organization
from sentry.search.eap import constants
from sentry.search.eap.columns import translate_internal_to_public_alias
from sentry.search.eap.spans import SearchResolver
from sentry.search.eap.resolver import SearchResolver
from sentry.search.eap.span_columns import SPAN_DEFINITIONS, translate_internal_to_public_alias
from sentry.search.eap.types import SearchResolverConfig
from sentry.search.events.builder.base import BaseQueryBuilder
from sentry.search.events.builder.spans_indexed import SpansIndexedQueryBuilder
Expand Down Expand Up @@ -110,7 +110,9 @@ def get(self, request: Request, organization: Organization) -> Response:
hour=0, minute=0, second=0, microsecond=0
) + timedelta(days=1)

resolver = SearchResolver(params=snuba_params, config=SearchResolverConfig())
resolver = SearchResolver(
params=snuba_params, config=SearchResolverConfig(), definitions=SPAN_DEFINITIONS
)
meta = resolver.resolve_meta(referrer=Referrer.API_SPANS_TAG_KEYS_RPC.value)

rpc_request = TraceItemAttributeNamesRequest(
Expand Down Expand Up @@ -406,7 +408,9 @@ def __init__(
max_span_tag_values: int,
):
super().__init__(organization, snuba_params, key, query, max_span_tag_values)
self.resolver = SearchResolver(params=snuba_params, config=SearchResolverConfig())
self.resolver = SearchResolver(
params=snuba_params, config=SearchResolverConfig(), definitions=SPAN_DEFINITIONS
)
self.search_type, self.attribute_key = self.resolve_attribute_key(key, snuba_params)

def resolve_attribute_key(
Expand Down
Loading

0 comments on commit 0e89a6d

Please sign in to comment.