Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/sentry/api/endpoints/organization_spans_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
from sentry.api.paginator import ChainPaginator
from sentry.api.serializers import serialize
from sentry.api.utils import handle_query_errors
from sentry.auth.staff import is_active_staff
from sentry.auth.superuser import is_active_superuser
from sentry.models.organization import Organization
from sentry.search.eap import constants
from sentry.search.eap.resolver import SearchResolver
from sentry.search.eap.spans.definitions import SPAN_DEFINITIONS
from sentry.search.eap.types import SearchResolverConfig, SupportedTraceItemType
from sentry.search.eap.utils import translate_internal_to_public_alias
from sentry.search.eap.utils import can_expose_attribute, translate_internal_to_public_alias
from sentry.search.events.types import SnubaParams
from sentry.snuba.referrer import Referrer
from sentry.tagstore.types import TagValue
Expand Down Expand Up @@ -118,12 +120,19 @@ def get(self, request: Request, organization: Organization) -> Response:

rpc_response = snuba_rpc.attribute_names_rpc(rpc_request)

include_internal = is_active_superuser(request) or is_active_staff(request)

paginator = ChainPaginator(
[
[
as_tag_key(attribute.name, serialized["type"])
for attribute in rpc_response.attributes
if attribute.name
and can_expose_attribute(
attribute.name,
SupportedTraceItemType.SPANS,
include_internal=include_internal,
)
],
],
max_limit=max_span_tags,
Expand Down
Loading