Skip to content

feat(issues): Render flamegraph attachments in issue details - #126461

Open
philprime wants to merge 9 commits into
masterfrom
philprime/feat/flamegraph-attachment-ui
Open

philprime wants to merge 9 commits into
masterfrom
philprime/feat/flamegraph-attachment-ui

Conversation

@philprime

@philprime philprime commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Adds a dedicated Flamegraph section to issue details when an event has a version-1 event.flamegraph attachment. It uses the existing attachment listing and download endpoints, with loading, explicit retry, and unsupported-format handling. The section is gated by event-attachments and flamegraph-attachments.

The viewer reuses the profiling canvas, theme, hover tooltips, and scrolling used by MetricKit flamegraphs without changing the existing MetricKit implementation. A separate adapter converts attachment nodes into weighted paths, preserving inclusive counts, samples ending at intermediate nodes, repeated frames, and recursion. Multiple attachments and call trees can be selected independently. Unclassified frames use the system-frame color.

Backend prerequisite: #126459. Land the backend first so the feature flag is exposed to the UI.

The 33 focused tests include the existing MetricKit and view-hierarchy suites. Full frontend typechecking and lint passed. Playwright verification against a local event attachment confirmed a painted canvas, independent tree counts, hover tooltips, scrolling, and collapse persistence. Diagnostic payloads and browser artifacts are not included.

Download version-1 flamegraph attachments and adapt their independent call trees to the existing

count-based profiling visualization. Keep MetricKit rendering unchanged and gate the new viewer

behind the flamegraph attachment feature flag.
@philprime philprime self-assigned this Oct 5, 2026
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Story previews

Preview the stories changed in this PR on the Vercel deployment:

Preview deployment: https://sentry-b5afbxnmv.sentry.dev

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 95.77% 95.77% ±0%
Typed 141,373 141,458 🟢 +85
Untyped 6,247 6,255 🔴 +8
🔍 8 new type safety issues introduced

Non-null assertions (!) (7 new)

File Line Detail
static/app/components/events/flamegraphAttachment/index.tsx 34 data.trees[selectedTree]!
static/app/components/events/flamegraphAttachment/utils.ts 56 data.nodes[id]!
static/app/components/events/flamegraphAttachment/utils.ts 69 pending.pop()!
static/app/components/events/flamegraphAttachment/utils.ts 83 data.nodes[current.id]!
static/app/components/events/flamegraphAttachment/utils.ts 126 data.nodes[id]!
static/app/components/events/flamegraphAttachment/utils.ts 131 data.nodes[child]!
static/app/components/events/flamegraphAttachment/utils.ts 137 children[index]!

Type assertions (as) (1 new)

File Line Detail
static/app/components/events/flamegraphAttachment/utils.ts 123 as number[] — [] as number[]

This is informational only and does not block the PR.

@philprime
philprime marked this pull request as ready for review October 15, 2026 13:38
@philprime
philprime requested review from a team as code owners October 15, 2026 13:38

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

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 abc84f3. Configure here.

Comment thread static/app/components/events/eventFlamegraph.tsx
Comment thread static/app/components/events/flamegraphAttachment/utils.ts Outdated
Comment thread static/app/components/events/eventFlamegraph.spec.tsx Outdated
Comment thread static/app/components/events/eventFlamegraph.spec.tsx Outdated
Comment thread static/app/components/events/eventFlamegraph.spec.tsx Outdated
@linear-code

linear-code Bot commented Oct 16, 2026

Copy link
Copy Markdown

COCOA-2071

@scttcper scttcper left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good!

@philprime
philprime enabled auto-merge (squash) October 21, 2026 15:02
@philprime

Copy link
Copy Markdown
Member Author

@scttcper I slightly adapted the algorithm to reconstruct the tree due to changes in the (draft) file changes here: getsentry/sentry-docs#20073

No visual changes, tried it locally using https://sentry-sdks.sentry.io/issues/7738016221/events/8b04e1bf48504280842443da5575c9fb/ but disabling the feature flag check, as the flag has not been merged yet: https://github.com/getsentry/sentry-options-automator/pull/10184

@sentry

sentry Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
- - - - - - ✅ 754 uploaded

Base commit 9bd9d0fc1ce9e40ac33ad162144bd39c943e421f did not produce snapshots to compare against. Did its snapshot job fail? Try rebasing this branch on a commit with a successful snapshot job.

⚙️ sentry-frontend Snapshot Settings

This branch was successfully deployed

1 active deployment
Preview — 1ca9b6f7 Deployed Oct 21, 2026 by vercel[bot]
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 State: Blocked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants