chore(explore): Remove TraceItemAttributeContext provider pattern#108552
Draft
nsdeschenes wants to merge 10 commits intomasterfrom
Draft
chore(explore): Remove TraceItemAttributeContext provider pattern#108552nsdeschenes wants to merge 10 commits intomasterfrom
nsdeschenes wants to merge 10 commits intomasterfrom
Conversation
Contributor
Author
|
@sentry review |
Contributor
Author
|
@cursor review |
…eItemAttributes Rename deprecated useTraceItemAttributesWithConfig calls to useTraceItemAttributes in all consumers and remove the deprecated export. These callers already pass config objects directly.
… directly Migrate callers that relied on TraceItemAttributeProvider context to pass TraceItemAttributeConfig directly. Move search state into toolbar components. Remove provider wrappers that only existed to serve these callers.
…plore callers Update spanTagsContext's useTraceItemTags to accept a TraceItemAttributeConfig as the first argument. Migrate all explore callers to pass config directly instead of relying on the context provider. Key changes: - spanTagsContext.tsx: require config param, pass through to useTraceItemAttributes - useSortByFields.tsx: accept config param, callers pass it - toolbar components (visualize, groupBy): move search state into component, remove TraceItemAttributeProvider wrapper - spansTabSearchSection.tsx: pass config to all useTraceItemTags calls, remove provider wrapper for cross-event search bars - tables, multiquery, and other explore callers: pass spansConfig
Create useWidgetBuilderTraceItemConfig helper hook that extracts the dataset → TraceItemAttributeConfig mapping logic from TraceItemAttributeProviderFromDataset. Migrate all widget builder consumers (visualize, groupBySelector, sortBySelector, xAxisSelector, exploreArithmeticBuilder) to use the new hook and pass config to useTraceItemTags.
…ecated code All consumers have been migrated to pass config directly. This commit: - Removes TraceItemAttributeProvider, TraceItemAttributeContext, and overload resolution helpers from traceItemAttributeContext.tsx - Simplifies useTraceItemAttributes to only accept (config, type?, hiddenKeys?) - Removes provider wrappers from spans/content.tsx, logs/content.tsx, multiQueryMode/content.tsx, newWidgetBuilder.tsx - Deletes InsightsSpanTagProvider and removes it from 6 insights consumers - Removes provider wrappers from 8 additional insights pages and metricsSection.tsx
…ppers Remove TraceItemAttributeProvider from test wrappers across all spec files. Tests already mock the /trace-items/attributes/ API endpoint, so the components' internal useTraceItemAttributes calls with config will hit those mocks directly. Also update useTraceItemTags mock signatures to match the new (config, type?, hiddenKeys?) signature.
- Add back TraceItemDataset import to logsTab.tsx (needed for config) - Add config param to useSortByFields.spec.tsx test calls
Pass the selected alert project into EAPField and include it in trace item attribute config so aggregate options stay scoped to the alert project. Also remove the now-unnecessary EAPField wrapper export. Co-authored-by: Cursor <cursoragent@cursor.com>
Clean up unnecessary React Fragment wrappers in metric rule conditions and multi-query mode tests to simplify render trees without behavior changes. Co-authored-by: Cursor <cursoragent@cursor.com>
5a7161c to
cb432a9
Compare
Contributor
Author
|
@sentry review |
Contributor
Author
|
@cursor review |
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.
Summary
Migrates all consumers of
TraceItemAttributeProvidercontext to pass config directly touseTraceItemAttributes/useTraceItemTags, then removes the deprecated provider infrastructure entirely.This is the follow-up to #108019 (EXP-726) which added config-based overloads. This PR (EXP-727) completes the migration.
Highly recommend review with whitespace hidden.
Ticket: EXP-727