Skip to content

feat(chunks): Accept android profiles in sample v2 format - #93

Merged
markushi merged 5 commits into
mainfrom
markushintersteiner/java-603-update-vroomrs-to-accept-android-profiles-in-v2-format
Jul 9, 2026
Merged

feat(chunks): Accept android profiles in sample v2 format#93
markushi merged 5 commits into
mainfrom
markushintersteiner/java-603-update-vroomrs-to-accept-android-profiles-in-v2-format

Conversation

@markushi

@markushi markushi commented Jul 2, 2026

Copy link
Copy Markdown
Member

Dispatch profile chunk deserialization on the profile version instead of the platform.

Previously any chunk with platform: "android" was assumed to be in the legacy android trace format, so android profiles in the sample v2 format (version: "2", emitted by newer Android SDKs) could not be processed properly. Relay will soon start emitting version: "2.android-trace" for chunks in the legacy trace format, which makes the version the reliable discriminator.

Changes:

  • Add ProfileChunk::from_json_vec_**and_version**: "" | "2.android-trace" maps to the legacy android trace format, any other version to sample v2.
  • Deprecate ProfileChunk::from_json_vec_and_platform in favor of the new method
  • The version is now persisted within the android chunk json blob

Transaction-based profiles (Profile) are unaffected; the new version only applies to profile chunks.

This unblocks sample v2 android support in the consuming service: getsentry/sentry#118849.
The vroom service changes are already merged / shipped: getsentry/vroom#672

Fixes JAVA-603

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Jul 2, 2026

Copy link
Copy Markdown

JAVA-603

@markushi

markushi commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@sentry review

Comment thread src/android/chunk.rs
@markushi
markushi marked this pull request as ready for review July 2, 2026 13:01
@markushi
markushi requested a review from a team as a code owner July 2, 2026 13:01
@markushi
markushi requested a review from 0xadam-brown July 2, 2026 13:01
Relay will start emitting version "2.android-trace" for android
profiles in the legacy android trace format, while android profiles in
the sample v2 format carry version "2". Previously any profile with
platform "android" was assumed to be in the legacy trace format, so
sample v2 android chunks could not be processed.

Dispatch profile chunk deserialization on the version instead of the
platform: add ProfileChunk::from_json_vec_and_version and deprecate
from_json_vec_and_platform, since the platform alone cannot distinguish
the two formats. profile_chunk_from_json_str accepts a new optional
version argument that takes precedence over platform. As a fallback to
the legacy behavior in vroom, a missing or empty version is treated as
the android trace format, and AndroidChunk now retains the version
field so it survives compression round trips.

Fixes JAVA-603

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@markushi
markushi force-pushed the markushintersteiner/java-603-update-vroomrs-to-accept-android-profiles-in-v2-format branch from 6c14764 to d670a07 Compare July 2, 2026 13:37
vroom maps any non-empty version to the sample format when reading
chunks from storage, so persisting "2.android-trace" would break its
read path. Drop the version field from AndroidChunk: unknown fields are
ignored during deserialization, so ingest still accepts payloads
carrying the new version, while stored chunks remain version-less and
readable by both vroom and vroomrs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@0xadam-brown 0xadam-brown 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.

Thanks a bunch for this!

A few comments; otherwise looking great 🙌

Comment thread src/lib.rs Outdated
Comment thread src/lib.rs Outdated
Comment thread src/lib.rs
Comment thread src/profile_chunk.rs Outdated
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b3201f1. Configure here.

Comment thread src/android/chunk.rs
Comment thread src/android/chunk.rs
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@markushi
markushi merged commit f512c83 into main Jul 9, 2026
18 checks passed
@markushi
markushi deleted the markushintersteiner/java-603-update-vroomrs-to-accept-android-profiles-in-v2-format branch July 9, 2026 07:13
markushi added a commit to getsentry/sentry that referenced this pull request Jul 13, 2026
The Android SDK can now emit **sample v2** profiles in addition to the
legacy android trace format. This wires the profiling pipeline to be
able to process both.

The whole pipeline previously always assumed that `platform="android"`
provided a profile in the Android trace format - regardless if
`version="2"` was set or not.

`platform: "java"` profiles (aka profiles from backend services) are
intentionally not deobfuscated for now, but support could be easily
added.

Also removes `get_data_category`, dead code since #81481.

> [!NOTE]
> `vroom` and `vroomrs` need to be updated as well to support the sample
v2 Android format.
> See getsentry/vroom#672 (was automatically
deployed earlier this week)
> and getsentry/vroomrs#93 (landed in `0.1.22`,
which is bumped in this PR as well)

### Testing

- Unit tests for the classifiers, frame conversion and the sample v2
merge/stack-remap (inline expansion + native passthrough).
- Symbolicator integration tests for sample v2 (basic + inline) plus a
full `process_profile_task` run.

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
0xadam-brown added a commit to getsentry/sentry-java that referenced this pull request Jul 24, 2026
Commit updates the platform used with ANR profiles from Java to Android so that we can properly bill ANR profiling under UI Profile Hours rather than Continuous Profile Hours.

Depends on the updates made in [Relay #6183](getsentry/relay#6183), [getsentry #118849](getsentry/sentry#118849), [vroomrs #93](getsentry/vroomrs#93), and [vroom #672](getsentry/vroom#672).
0xadam-brown added a commit to getsentry/sentry-java that referenced this pull request Jul 28, 2026
Commit updates the platform used with ANR profiles from Java to Android so that we can properly bill ANR profiling under UI Profile Hours rather than Continuous Profile Hours.

Depends on the updates made in [Relay #6183](getsentry/relay#6183), [getsentry #118849](getsentry/sentry#118849), [vroomrs #93](getsentry/vroomrs#93), and [vroom #672](getsentry/vroom#672).

# Conflicts:
#	CHANGELOG.md
0xadam-brown added a commit to getsentry/sentry-java that referenced this pull request Jul 28, 2026
Commit updates the platform used with ANR profiles from Java to Android so that we can properly bill ANR profiling under UI Profile Hours rather than Continuous Profile Hours.

Depends on the updates made in [Relay #6183](getsentry/relay#6183), [getsentry #118849](getsentry/sentry#118849), [vroomrs #93](getsentry/vroomrs#93), and [vroom #672](getsentry/vroom#672).

# Conflicts:
#	CHANGELOG.md
0xadam-brown added a commit to getsentry/sentry-java that referenced this pull request Jul 29, 2026
#5836)

Commit updates the platform used with ANR profiles from Java to Android so that we can properly bill ANR profiling under UI Profile Hours rather than Continuous Profile Hours.

Depends on the updates made in [Relay #6183](getsentry/relay#6183), [getsentry #118849](getsentry/sentry#118849), [vroomrs #93](getsentry/vroomrs#93), and [vroom #672](getsentry/vroom#672).

Co-authored-by: Markus Hintersteiner <markus.hintersteiner@sentry.io>
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.

4 participants