Skip to content

fix(api): Hide internal trace attributes from discovery#116092

Closed
nsdeschenes wants to merge 2 commits into
masterfrom
nd/feat-attributes-visibility-discovery
Closed

fix(api): Hide internal trace attributes from discovery#116092
nsdeschenes wants to merge 2 commits into
masterfrom
nd/feat-attributes-visibility-discovery

Conversation

@nsdeschenes
Copy link
Copy Markdown
Contributor

Summary

  • Apply can_expose_attribute_to_api() filtering to OrganizationTraceItemAttributesEndpoint — internal attributes are excluded from attribute search, autocomplete, and aliased column listings
  • Apply the same filtering to OrganizationSpansFieldsEndpoint and EAPSpanFieldValuesAutocompletionExecutor — internal span fields and their values are hidden from non-staff users
  • Staff/superuser requests bypass the filter via include_internal=True

Depends on #116091

Test plan

  • New tests in test_organization_trace_item_attributes.py and test_organization_spans_fields.py verifying internal attributes are excluded from responses

Closes TODO

Add a shared helper for hiding internal Sentry convention attributes from API surfaces and let SearchResolver track attributes hidden by API visibility configuration.

This keeps default resolver behavior unchanged unless an API caller opts into visibility enforcement.
Filter internal Sentry convention attributes from trace item and span attribute discovery APIs unless the requester is staff or superuser.

Apply the same visibility checks to attribute value autocomplete and validation so hidden attributes are treated as unknown for regular users.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 22, 2026
Base automatically changed from nd/feat-attributes-visibility-core to master May 27, 2026 13:24
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 27, 2026

EXP-966

@nsdeschenes
Copy link
Copy Markdown
Contributor Author

Closing out in favour of a clean slate.

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