Skip to content

fix(api): Filter internal trace attributes from results#116093

Draft
nsdeschenes wants to merge 1 commit into
nd/feat-attributes-visibility-corefrom
nd/feat-attributes-visibility-detail-endpoints
Draft

fix(api): Filter internal trace attributes from results#116093
nsdeschenes wants to merge 1 commit into
nd/feat-attributes-visibility-corefrom
nd/feat-attributes-visibility-detail-endpoints

Conversation

@nsdeschenes
Copy link
Copy Markdown
Contributor

Summary

  • Apply visibility checks to trace item detail, stats, and ranked attribute endpoints — queries referencing hidden internal attributes return empty results instead of leaking internal data
  • Thread include_internal parameter through spans_rpc, occurrences_rpc, and data_export callers
  • Add has_hidden_api_attributes() short-circuit in RPCBase.run_table_query() to avoid dispatching RPCs when the query is guaranteed to return nothing useful

Depends on #116091

Test plan

  • New tests in test_project_trace_item_details.py, test_organization_trace_item_stats.py, and test_organization_trace_item_attributes_ranked.py

Closes TODO

Apply EAP API visibility checks to trace item stats, ranked attribute comparisons, trace item detail serialization, exports, and RPC table/stat responses.

Hidden attributes in query filters now return empty results instead of broadening the query for regular users.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 22, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ab4a530. Configure here.

cohort_1_distribution_map={},
total_cohort_1=0,
cohort_1_function_value=function_value,
)
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.

Ranked resolver misses hidden function

Medium Severity

The ranked-attribute flow calls Spans.run_table_query without passing the shared SearchResolver, so hidden API fields referenced only in the percentile function are tracked on a throwaway resolver. has_hidden_api_attributes() on the main resolver stays false and the endpoint can still run full distribution analysis instead of returning empty ranked results.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ab4a530. Configure here.

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 22, 2026

EXP-966

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

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant