Description
ANR profile chunks are currently (and wrongly) counted against customers' Continuous Profile Hours rather than UI Profile Hours. The proximate cause is the Android SDK, which always labels profile chunks as having come from the "java" platform rather than "android". (Relay attributes all "java" profile chunks to Continuous Profile Hours and "android" to UI Profile Hours.)
We need to fix that, but we can't do so naively b/c of the way Relay, vroomrs, and the Monolith all currently process "android" profile chunks. This issue tracks the work needed to fix the backend pipeline, and then the SDK.
Proposed approach
SDK
Current behavior: Registers "java" as the platform for all v2 profile chunks, including ANR profiles.
Fix: Use "android" instead.
Fix must only be made after the backend changes described below (as the "Behavior after SDK update" sections indicate).
Relay
Behavior after SDK update: The chunk dispatcher matches "android" before "v2", which forces all Android-platform chunks through the legacy trace-log parser. Sample-v2 chunks (which ANR uses) would fail with NotEnoughSamples and drop.
Fix: gate the "android" arm on the legacy sampled_profile field's presence, or swap arm priority so V2 wins first.
vroomrs
Behavior after SDK update: The chunk dispatcher short-circuits to AndroidChunk (Perfetto/legacy) on platform="android" regardless of version. Sample-v2 chunks would fail to parse.
Fix: have the monolith stop passing the platform hint (pass None), or have vroomrs check version before honoring the platform hint.
Monolith
Behavior after the SDK update: _deobfuscate is gated by SHOULD_DEOBFUSCATE = frozenset(["android"]). Once the platform flips to "android", ANR chunks enter the deobfuscation path, which expects legacy-shape fields (build_id, profile.methods) that sample-v2 chunks don't have. The chunk KeyErrors and drops with profiling_failed_deobfuscation – a real regression from today, where the obfuscated chunk at least reaches GCS.
Fix: #5510's monolith change (sample-v2 branch in _deobfuscate) must land first.
Description
ANR profile chunks are currently (and wrongly) counted against customers' Continuous Profile Hours rather than UI Profile Hours. The proximate cause is the Android SDK, which always labels profile chunks as having come from the "java" platform rather than "android". (Relay attributes all "java" profile chunks to Continuous Profile Hours and "android" to UI Profile Hours.)
We need to fix that, but we can't do so naively b/c of the way Relay, vroomrs, and the Monolith all currently process "android" profile chunks. This issue tracks the work needed to fix the backend pipeline, and then the SDK.
Proposed approach
SDK
Current behavior: Registers "java" as the platform for all v2 profile chunks, including ANR profiles.
Fix: Use "android" instead.
Fix must only be made after the backend changes described below (as the "Behavior after SDK update" sections indicate).
Relay
Behavior after SDK update: The chunk dispatcher matches "android" before "v2", which forces all Android-platform chunks through the legacy trace-log parser. Sample-v2 chunks (which ANR uses) would fail with NotEnoughSamples and drop.
Fix: gate the "android" arm on the legacy sampled_profile field's presence, or swap arm priority so V2 wins first.
vroomrs
Behavior after SDK update: The chunk dispatcher short-circuits to AndroidChunk (Perfetto/legacy) on platform="android" regardless of version. Sample-v2 chunks would fail to parse.
Fix: have the monolith stop passing the platform hint (pass None), or have vroomrs check version before honoring the platform hint.
Monolith
Behavior after the SDK update: _deobfuscate is gated by SHOULD_DEOBFUSCATE = frozenset(["android"]). Once the platform flips to "android", ANR chunks enter the deobfuscation path, which expects legacy-shape fields (build_id, profile.methods) that sample-v2 chunks don't have. The chunk KeyErrors and drops with profiling_failed_deobfuscation – a real regression from today, where the obfuscated chunk at least reaches GCS.
Fix: #5510's monolith change (sample-v2 branch in _deobfuscate) must land first.