Skip to content

feat(explore): Add metric descriptions viewer/editor page#120242

Draft
DominikB2014 wants to merge 2 commits into
masterfrom
claude/metric-descriptions-ui-7bd70e
Draft

feat(explore): Add metric descriptions viewer/editor page#120242
DominikB2014 wants to merge 2 commits into
masterfrom
claude/metric-descriptions-ui-7bd70e

Conversation

@DominikB2014

@DominikB2014 DominikB2014 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Rough first pass at a page for browsing and editing trace metric descriptions, assisted query agent picks these up to make better queries.

image image

Adds a basic list page for browsing and editing authored trace metric
descriptions (name, type, brief, additional context), backed by the
new trace-items/metrics list and context endpoints. Supports search,
filtering by metric type, and 100-per-page pagination. Linked from the
metrics explorer via a new button next to "Add Metric".
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 21, 2026
// Scope the request to the currently selected projects / environments /
// time range, so the endpoint's existence check matches what was listed.
const query: Record<string, string | string[] | number[] | undefined> = {
project: selection.projects.length ? selection.projects.map(String) : ['-1'],

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.

List save project scope mismatch

Medium Severity

The descriptions list omits the project query param when selection.projects is empty, but the edit modal sends project: ['-1']. The PUT handler uses those params for Snuba existence checks, so saves can fail with “metric not found” for rows that appeared in the table.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 67d7e8a. Configure here.

<SimpleTable.Empty>{t('No metrics found.')}</SimpleTable.Empty>
) : (
metrics.map(metric => (
<SimpleTable.Row key={`${metric.name}:${metric.type}`}>

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.

Table row keys omit unit

Medium Severity

Each table row uses a React key of only metric.name and metric.type, but the metrics list API groups rows by name, type, and unit. Two rows with the same name and type but different units share a key, which can confuse React reconciliation and row-level UI such as Edit.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 67d7e8a. Configure here.

Follows the metrics list endpoint's alignment to the attributes
`details: list[str]` context shape (#120344), and adds
a dropdown to filter to metrics with authored context via `contextOnly`.

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

There are 5 total unresolved issues (including 2 from previous reviews).

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 3f96db7. Configure here.

<Text>{metric.context.details.join(' ')}</Text>
) : (
<Text variant="muted">{'—'}</Text>
)}

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.

Wrong additional context field

High Severity

The list API returns authored notes on context.additionalContext, but the UI reads context.details. The table always shows “—”, the edit form opens empty, and a save sends additionalContext: null, which can erase stored notes when only the brief is changed.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3f96db7. Configure here.

query: buildQueryString({search, type}),
// Restricts results to metrics that already have authored context.
contextOnly: hasContext ? '1' : undefined,
cursor: cursor || undefined,

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.

Description filter query ignored

Medium Severity

The “Has description” filter sets contextOnly=1 on the metrics list request, but the trace metrics list endpoint only validates query and expand, so the parameter has no effect and the table still lists metrics without descriptions.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3f96db7. Configure here.

cursor: cursor || undefined,
project: selection.projects.length ? selection.projects.map(String) : undefined,
environment: selection.environments.length ? selection.environments : undefined,
};

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.

Search omits case insensitivity

Low Severity

Name search builds the same contains filter as the explore metric picker but never sends caseInsensitive=1. The metrics list uses default case-sensitive matching, so searches can miss metrics that the picker would find for the same text.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3f96db7. Configure here.

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

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant