feat(eap): gate unpopulated normalized columns behind a per-org allowlist - #8204
Open
pbhandari wants to merge 9 commits into
Open
feat(eap): gate unpopulated normalized columns behind a per-org allowlist#8204pbhandari wants to merge 9 commits into
pbhandari wants to merge 9 commits into
Conversation
…columns for which to use the index
pbhandari
marked this pull request as ready for review
July 21, 2026 20:34
Contributor
|
Is the idea here that we're going to evaluate this for a few orgs, and then delete this whole [logic] branch? I'm asking because we have 10s of thousands of active orgs, and so if you want to gradually roll out 0 -> 100 then a hardcoded allow-list won't work very well and you'll have to do something like |
Contributor
Author
|
@onewland Yeah, the idea just to allow for smoke tests to happen with the data and we roll out to a small subset of orgs initially. And when we are ready to release it for everyone, we just move the fields into the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Gate the not-yet-populated EAP-items normalized columns (
sentry.session_id→session_id,gen_ai.conversation.id→ai_conversation_id) behind a per-organization allowlist instead of resolving them unconditionally.A new sentry-option,
eap_items_unpopulated_normalized_columns_org_allowlist(comma-separated org ids), controls it:attributes_*map path, which covers historical rows the dedicated columns were never populated with.Unlike
org_ids_delete_allowlist, an empty allowlist means no orgs are opted in — the feature stays off until an org is explicitly added. A malformed allowlist (stray comma, non-numeric entry) is logged and treated as opted out rather than breaking every EAP query.How
get_normalized_columns_eap_items(organization_id)now takes the org and consults the allowlist. Rather than a global/ambient flag,organization_idis threaded explicitly as an argument through the query-build path:attribute_key_to_expression(attr_key, organization_id)andtrace_item_filters_to_expression(..., *, organization_id)(keyword-only) carry it.aggregation.pyhelpers that build filter conditions (aggregation_to_expression,get_confidence_interval_column,get_average_sample_rate_column,get_count_column, and their internals) take a keyword-onlyorganization_id.request.meta.organization_id. The resolver callables are typedCallable[[AttributeKey, int], Expression]and receive the org id as a plain argument — nofunctools.partialbinding.Non-RPC delete path (
delete_query.py): the org is taken from the delete'scolumn_conditions(deletes are per-org), falling back toNone(no org in context ⇒ feature off).Test plan
tests/web/rpc/v1/test_indexed_columns.pycoverage:bf_session_id/bf_ai_conversation_id) is applied and filters match the expected rows.TestGetNormalizedColumnsEapItemsintests/protos/test_protos_common.pyexercises the gate directly (opted in, absent org,Noneorg, empty allowlist, and malformed allowlists → opted out).mypy .clean (1074 files);ruff check/formatclean.test_common.py,test_aggregation.py,test_protos_common.py, etc.) for the new signatures.Notes
ref/use-indexed-columns); review/merge that one first.🤖 Generated with Claude Code