Skip to content

ref(eap): Gate indexed_name rewrite on TIER_1 instead of org option - #8482

Closed
pbhandari wants to merge 1 commit into
masterfrom
ref/eap-indexed-name-tier-gate
Closed

pbhandari wants to merge 1 commit into
masterfrom
ref/eap-indexed-name-tier-gate

Conversation

@pbhandari

@pbhandari pbhandari commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Fixes EAP-775

What

Replace eap_items_use_indexed_name_organization_ids with a sampling-tier gate: rewrite sentry.op / sentry.metric.name filters onto indexed_name only on TIER_1 (full accuracy).

Downsampled tiers keep the attribute-map path since the indexed columns don't contain backfilled data, and therefore don't have data on those columns.

The org allowlist was a rollout switch. However we have no need for it anymore since we've been backfilling data for 40ish days.

Test plan

  • pytest tests/web/rpc/test_common.py::TestIndexedNameRedirect

@pbhandari
pbhandari requested review from a team as code owners September 18, 2026 17:54
@linear-code

linear-code Bot commented Sep 18, 2026

Copy link
Copy Markdown

EAP-775

Comment on lines 830 to -837
"description": "Unix timestamp of the earliest weekly date bucket the v2 co-occurring-attributes tables hold data for; TraceItemAttributeNames only reads v2 for requests whose range starts at or after it, and reads v1 otherwise. Defaults to 2026-07-27 00:00 UTC, the Monday of the week the v2 tables and their materialized view were created. Must be a Monday: the date column is bucketed weekly with toMonday() and the query rounds its lower bound down to the previous Monday, so a mid-week value would let a request read a bucket v2 never populated. Lower it only to a bucket v2 has been backfilled to."
},
"eap_items_use_indexed_name_organization_ids": {
"type": "array",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't actually used in the options-automator. should be safe to remove I think.

limit: int,
page_token: ExportTraceItemsPageToken | None = None,
query_meta: RequestMeta | None = None,
sampling_tier: Tier = Tier.TIER_1,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not have yet another default/fallback for the tier. Can we wire it from the routing context?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the default. _build_query now requires sampling_tier (kw-only) and _build_snuba_request passes routing_decision.tier.

request.meta.trace_item_type,
request.filter,
_get_attribute_key_to_expression_function(request.meta),
use_indexed_name=use_indexed_name_for_request(sampling_tier or Tier.TIER_1),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of "or Tier_1"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped the or TIER_1. use_indexed_name_for_request is now tier == TIER_1, so None does not rewrite.

@ElioDiNino ElioDiNino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment, looks good otherwise

Comment thread snuba/web/rpc/v1/endpoint_trace_item_details.py
@pbhandari
pbhandari force-pushed the ref/eap-indexed-name-tier-gate branch from dc6013e to 79f35e7 Compare September 18, 2026 20:35

@MeredithAnya MeredithAnya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 1 can have different retention so unless we have been writing data for longer than the maximum allowed retention e.g. 90 days, then this could return incomplete data - so the sentry option may have to remain for a while longer

@pbhandari

Copy link
Copy Markdown
Contributor Author

We also were not indexing the right field. So this would be bad even for 30 days retention customers. I'm closing this PR.

@pbhandari pbhandari closed this Sep 23, 2026
@pbhandari
pbhandari deleted the ref/eap-indexed-name-tier-gate branch September 23, 2026 18:52
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.

4 participants