Skip to content

feat(anr): Send ANR profiles as flame graph attachments instead of profile chunks - #6597

Draft
markushi wants to merge 2 commits into
feat/anr-profile-flamegraphfrom
feat/anr-flamegraph-replace-profile-chunk
Draft

markushi wants to merge 2 commits into
feat/anr-profile-flamegraphfrom
feat/anr-flamegraph-replace-profile-chunk

Conversation

@markushi

@markushi markushi commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

PR Stack (ANR Flame Graph)


📜 Description

ANR profiles are now sent as a flame graph attachment (flamegraph.json, event.flamegraph) on the ANR event, instead of a separate profile chunk. The event no longer gets a profile context.

  • The flame graph is attached whenever a foreground ANR has a profile whose time range covers the ANR, also when no culprit stack is identified. The culprit still replaces the event exception, as before.
  • The ProGuard UUID comes from the build that recorded the profile (persisted options after an app update), and falls back to the current UUID, matching the old profile chunk behavior.
  • StackTraceConverter (AnrProfile → SentryProfile) has no callers left and is removed. Its two frame helpers move into AnrFlameGraphAttachment.
  • AnrHintEnricher casts to AnrV2Hint once, which removes the impossible AbnormalExit / null-timestamp branches. Hint names are untangled: hint is only the io.sentry.Hint container, sdkHint the unwrapped object, backfillable the generic view, anrHint the AnrV2Hint.

💡 Motivation and Context

An ANR profile is a few seconds of main thread samples. A flame graph attachment shows the aggregated call tree directly on the issue, without the profile chunk pipeline.

💚 How did you test it?

Unit tests: ApplicationExitInfoEventProcessorTest (flame graph attached, persisted and fallback ProGuard UUID, no culprit), AnrFlameGraphAttachmentTest (native frames and unknown line numbers, previously covered by AnrStackTraceConverterTest).

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • No breaking change or entry added to the changelog.

🔮 Next steps

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against ca663ea

@sentry

sentry Bot commented Nov 12, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.64.0 (1) release

⚙️ sentry-android Build Distribution Settings

This branch has not been deployed

No deployments
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.

1 participant