Skip to content

feat(explore): heatmap tooltip trace links#115925

Merged
nikkikapadia merged 6 commits into
masterfrom
nikki/feat/heatmaps-trace-links
May 22, 2026
Merged

feat(explore): heatmap tooltip trace links#115925
nikkikapadia merged 6 commits into
masterfrom
nikki/feat/heatmaps-trace-links

Conversation

@nikkikapadia
Copy link
Copy Markdown
Member

I've added a View related traces link in the tooltip so that users can use heat maps to dig in to problem areas or general trends. The link should direct them to the traces page with the correct cross-event and page filters populated.

Couple things to note here:

  1. I think we're using a logarithmic y-axis scale so i might have to fix some of the link data
  2. the tooltip renderer for e-charts does not accept react components (which is why i've done the hacks that i've done)

Closes DAIN-1641

Before After
image image

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 20, 2026

DAIN-1641

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

📊 Type Coverage Diff

Metric Before After Delta
Coverage 93.57% 93.57% ±0%
Typed 133,188 133,210 🟢 +22
Untyped 9,146 9,147 🔴 +1
🔍 1 new type safety issue introduced

Type assertions (as) (1 new)

File Line Detail
static/app/views/dashboards/widgets/heatMapWidget/heatMapWidgetVisualization.tsx 93 `as {value?: unknown}

This is informational only and does not block the PR.

getSeriesValue(serie, 2) ?? 0,
4,
false
);
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.

Heatmap tooltip shows log-transformed Z-axis counts

Medium Severity

When scale="log" (used by MetricsHeatMap), heatMap.tsx stores Z values as Math.log1p(zValue) in the series data. The tooltip reads this transformed value via getSeriesValue(serie, 2) and formats it with formatAbbreviatedNumber, displaying the log-transformed number instead of the actual event count (e.g., ~6.9 instead of 1,000). An inverse transform like Math.expm1 is needed before formatting.

Additional Locations (1)
Fix in Cursor Fix in Web

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going to deal with the log stuff in a different PR after i talk to Will and see how it's being calculated in the backend and how (or if) i'd need to transform it on the frontend.

@nikkikapadia nikkikapadia marked this pull request as ready for review May 20, 2026 19:28
@nikkikapadia nikkikapadia requested review from a team as code owners May 20, 2026 19:28
Comment thread static/app/views/dashboards/widgets/heatMapWidget/heatMapWidgetVisualization.tsx Outdated
Copy link
Copy Markdown
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have import {useRenderToString} from '@sentry/scraps/renderToString' to generate markup from our components to pass to eCharts

@nikkikapadia
Copy link
Copy Markdown
Member Author

We have import {useRenderToString} from '@sentry/scraps/renderToString' to generate markup from our components to pass to eCharts

AH i had no idea, thanks for letting me know 😌

@nikkikapadia nikkikapadia marked this pull request as draft May 20, 2026 20:01
Comment thread static/app/components/charts/components/tooltip.tsx
Comment thread static/app/views/dashboards/widgets/heatMapWidget/heatMapWidgetVisualization.tsx Outdated
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

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 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

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 58d6674. Configure here.

@nikkikapadia nikkikapadia marked this pull request as ready for review May 21, 2026 18:53
Copy link
Copy Markdown
Contributor

@nsdeschenes nsdeschenes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of comments

Comment thread static/app/views/dashboards/widgets/heatMapWidget/plottables/heatMap.tsx Outdated
return data;
}

const value = (data as {value?: unknown} | null | undefined)?.value;
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.

nit: Any way we can get rid of this type cast 👀

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately not, the original typing for this value is from e-charts and this type in particular is not exported 😢

Comment thread static/app/views/dashboards/widgets/heatMapWidget/heatMapWidgetVisualization.tsx Outdated
@nikkikapadia nikkikapadia merged commit 8e21c10 into master May 22, 2026
81 of 83 checks passed
@nikkikapadia nikkikapadia deleted the nikki/feat/heatmaps-trace-links branch May 22, 2026 19:00
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.

3 participants