Skip to content

Seer Explorer: Android profiles silently fail in flamegraph tool #111695

@sentry-junior

Description

@sentry-junior

Summary

Seer Explorer's _convert_profile_to_execution_tree utility silently returns an empty tree when given an Android SDK profile. As a result, when the Seer agent attempts to render a flamegraph from an Android profile, it reports back that "the profile flamegraph isn't rendering for me via the tool," even though the profile data was fetched successfully.

Root cause

fetch_profile_data (and _convert_profile_to_execution_tree) in src/sentry/seer/explorer/utils.py assumes the sample profiling format, which stores frame data under profile["frames"]:

frames = profile.get("frames")   # ← android profiles don't use this key
stacks = profile.get("stacks")
samples = profile.get("samples")

if not all([frames, stacks, samples]):
    return [], None  # silent failure for android

Android SDK profiles store frame data under profile["profile"]["methods"], not frames. This divergence is already handled elsewhere in the codebase — task.py line ~1247 uses:

profile["profile"]["methods"] if platform == "android" else profile["profile"]["frames"]

And a convert_android_methods_to_jvm_frames helper exists for exactly this conversion. That helper is never called in the Seer explorer path.

Expected behavior

_convert_profile_to_execution_tree (or its caller fetch_profile_data) should detect Android profiles — via platform == "android" or presence of methods key — and convert them to the sample format using convert_android_methods_to_jvm_frames before attempting to parse frames / stacks / samples.

Alternatively, fetch_profile_data could request ?format=sample from the profiling service for Android profiles, if that conversion is available server-side.

Workaround

None at the Seer layer. Users asking Seer to correlate Android performance traces with profiles will consistently receive an unhelpful "can't render the flamegraph" response.

Action taken on behalf of Ido Shemesh.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions