getsentry / getsentry/sentry

Application Metrics table dashboard widgets cannot edit dimension columns

Open
#115,626 7 comments 0 reactions 1 assignee Claimed by @narsaynorath View on GitHub
Feature Product Area: Dashboards
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
21h 10m
Merged PRs (30d)
635

Description

### Environment

Sentry SaaS, Dashboards, Application Metrics dataset.

### Summary

Application Metrics table widgets can render and can be edited if they already exist, but the widget builder does not allow changing the table dimension column after duplicating/editing a widget.

For example, I have an Application Metrics table widget with:

- Display type: Table
- Dataset: Application Metrics
- Columns:
- `context`
- `sum(helloweather.internal)`

The table renders correctly, showing rows grouped by `context`.

When I duplicate/edit the widget and try to change the dimension column from `context` to `source`, the first column editor shows `None` / `None` instead of a dimension selector. The rendered preview still shows `CONTEXT`, but there is no usable UI to change it to `source`.

### Steps to reproduce

1. Create or open an Application Metrics dashboard table widget with a dimension column, e.g. `context`, and an aggregate, e.g. `sum(helloweather.internal)`.
2. Duplicate the widget or edit it.
3. In the widget builder, look at the `Columns` section.
4. Try to change the dimension column from `context` to another metric attribute, e.g. `source`.

### Expected behavior

The first column should be editable via a dimension/tag selector, allowing the user to change `context` to `source`, `status`, `paid`, etc.

Application Metrics table widgets should also be creatable from scratch if table rendering/querying is supported.

### Actual behavior

The table preview renders the saved dimension correctly, but the editor shows `None` / `None` for the dimension row. There does not appear to be a way to change the dimension column through the UI.

### Notes from source inspection

This looks like a frontend widget-builder issue:

- `TraceMetricsConfig` has table-query support via `useTraceMetricsTableQuery`, and tests cover `DisplayType.TABLE` with `dataset: 'tracemetrics'`.
- `TraceMetricsConfig.supportedDisplayTypes` omits `DisplayType.TABLE`, so new Application Metrics table widgets cannot be selected from scratch.
- In the Visualize step, `WidgetType.TRACEMETRICS` rows always render `MetricSelectRow`.
- `MetricSelectRow` appears designed for aggregate/function rows. Its `onChange` returns early unless `field.kind === 'function'`.
- For table dimension rows like `context` or `source`, the row is `field.kind === 'field'`, so the metric selector shows `None` and cannot update the dimension.

A likely fix would be to render the normal field/column selector for non-function `TRACEMETRICS` table rows, and reserve `MetricSelectRow` for aggregate rows. If trace-metrics table widgets are supported by the backend, `DisplayType.TABLE` may also need to be added to `TraceMetricsConfig.supportedDisplayTypes`.

### Screenshot

Image

via https://helloweather.sentry.io/dashboard/5448468/?statsPeriod=1h

The image on the left was created by Seer and uses a Table, but I can't duplicate and edit it properly (can't change the grouping) and the image on the left is what I can make successfully (but isn't the preferred Table design)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.