Skip to content

Conversation

jasonyuezhang
Copy link
Owner

Some basic stubs for the query params to be used in explore metrics. Currently using react state but can easily be swapped out later.


Copied from getsentry#100920
Original PR: getsentry#100920

Zylphrex and others added 2 commits October 4, 2025 18:24
Some basic stubs for the query params to be used in explore metrics. Currently
using react state but can easily be swapped out later.
Co-authored-by: Nar Saynorath <nar.saynorath@sentry.io>
Copy link

Initial Stubs for Query Parameters in Explore Metrics

This PR introduces new foundational code to support query parameters for the Explore Metrics section, implementing an initial stub architecture based on React state management. It splits filter and body UI logic, introduces stub metric rows, and starts new provider/context patterns for managing metric query parameters, setting the groundwork for more advanced features in the future.

Key Changes

• Refactored static/app/views/explore/metrics/metricsTab.tsx to divide logic into MetricsTabFilterSection and MetricsTabBodySection, now rendering mocked metric rows and separating filter display from body content.
• Added new file static/app/views/explore/metrics/metricRow.tsx with MetricRow and MetricToolbar components, integrating query param context and basic display structure for metrics.
• Introduced static/app/views/explore/metrics/metricsQueryParams.tsx to manage metric-specific query param context and state using React hooks and a MetricsQueryParamsProvider.
• Added utility static/app/utils/useResettableState.tsx for state management with reset functionality, and replaced in-place hook definitions in logs
• Added minimal static/app/views/explore/metrics/traceMetric.tsx interface for typing metric objects.
• Adjusted static/app/views/explore/components/traceItemSearchQueryBuilder.tsx to handle the new TraceItemDataset.TRACEMETRICS type, providing custom placeholder text and filter section logic.
• Updated static/app/views/explore/logs/styles.tsx to make sidebarOpen optional in BottomSectionBody styling, supporting new layout requirements.
• Refactored static/app/views/explore/logs/logsStateQueryParamsProvider.tsx to use the centralized useResettableState instead of in-file implementation.

Affected Areas

static/app/views/explore/metrics/metricsTab.tsx
static/app/views/explore/metrics/metricRow.tsx
static/app/views/explore/metrics/metricsQueryParams.tsx
static/app/views/explore/components/traceItemSearchQueryBuilder.tsx
static/app/views/explore/logs/logsStateQueryParamsProvider.tsx
static/app/views/explore/logs/styles.tsx
static/app/utils/useResettableState.tsx
static/app/views/explore/metrics/traceMetric.tsx

This summary was automatically generated by @propel-code-bot

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.

2 participants