Skip to content

Conversation

@jasonyuezhang
Copy link
Owner

  • Use Attribute Names RPC to fetch public attributes
  • filter to only the attributes available in the groupby

Copied from getsentry#101902
Original PR: getsentry#101902

@jasonyuezhang jasonyuezhang force-pushed the copy/pr-101902-comparative-workflows/filter-non-groupby-attrs branch 3 times, most recently from 7343fc7 to 1cbd57a Compare October 22, 2025 00:15
@jasonyuezhang jasonyuezhang force-pushed the copy/pr-101902-comparative-workflows/filter-non-groupby-attrs branch from 1cbd57a to a1271e9 Compare October 22, 2025 00:15
@propel-test-bot
Copy link

Filter Non-Groupby Attributes in Comparative Workflows Endpoint

This pull request updates the OrganizationTraceItemsAttributesRankedEndpoint to fetch and filter span attribute names using the attribute_names_rpc call. Only attributes available in the groupby (those returned by the Attribute Names RPC and deemed public/exposable) are included in the comparative attribute ranking results. The update also modifies test coverage to patch this new RPC, ensuring that only public attributes are passed to the response and internal/private/meta attributes are filtered out by the endpoint's logic.

Key Changes

• Added import and invocation of attribute_names_rpc with TraceItemAttributeNamesRequest to fetch possible public string attributes.
• Intersection filtering: only allow attributes present in the fetched attribute name allowlist and pass exposure checks using can_expose_attribute.
• Refactored filtering logic in the attribute processing loops for both cohorts.
• Extended test test_filters_out_internal_and_private_attributes: mocks attribute names RPC and verifies correct filtering of public/internal/meta/private attributes.

Affected Areas

src/sentry/api/endpoints/organization_trace_item_attributes_ranked.py (core endpoint logic)
tests/snuba/api/endpoints/test_organization_trace_item_attributes_ranked.py (targeted test coverage and mocking)

This summary was automatically generated by @propel-code-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants