feat(chunk): Add attachments to profile chunks#92
Closed
markushi wants to merge 3 commits into
Closed
Conversation
Add a generic `attachments` list to profile chunks, exposed through the Python API (`get_attachments` / `set_attachments` and a new `Attachment` class). Each attachment has a `name`, an optional `content_type`, and a `stored_id` referencing an object in the object store, e.g. a raw perfetto trace stored alongside the processed chunk. Attachments are supported on sample v2 chunks only: the getter returns an empty list and the setter is a no-op on legacy Android-format chunks. `set_attachments` replaces the whole list, keeping it idempotent on consumer retries. Also route android profiles that carry a version through sample-format detection, so android sample v2 chunks are no longer misrouted to the legacy Android format. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jun 14, 2026
Remove the no-op android attachments test and document the Attachment fields, clarifying that content_type is intentionally a free-form string that is passed through and not interpreted within this repo. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…profile Both from_json_vec and from_json_vec_and_platform now share a single detection path, parsing the minimum profile once per entry point. A chunk is treated as a legacy android chunk when its platform is android and it either has no version or still carries a sampled_profile. The sampled_profile check is an interim fix: some legacy android profiles are sent with version "2" even though they do not follow the sample v2 format and must still be parsed as android chunks. Also clarify that the Attachment name is a file name (e.g. raw_profile.pftrace). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a generic
attachmentslist to profile chunks, exposed through the Python API. Each attachment references a file stored in the object store — e.g. a raw perfetto trace kept alongside the Sentry-processed chunk — with aname(file name), an optionalcontent_type, and astored_id:What changed
Attachmentpyclass plusget_attachments/set_attachmentsonProfileChunk, with matching.pyistubs.attachmentsis added to the sample-v2 chunk format; it is omitted from JSON when empty.content_typeis intentionally a free-form string for now; it is passed through and not interpreted within this repo.Changed treatment of legacy Android profiles
Chunk-format detection is now unified:
from_json_vecandfrom_json_vec_and_platformshare a single detection path that parses the minimum profile once. A chunk is treated as a legacy Android chunk when:Two consequences:
version(and nosampled_profile) is now parsed as a sample-v2 chunk instead of the legacy Android format. This is required for android sample-v2 chunks to support attachments at all.versionset to"2"even though they don't follow the sample-v2 format. Thesampled_profilecheck keeps these routed to the legacy Android format so they still parse correctly.Design notes for reviewers
set_attachmentsreplaces the whole list rather than appending, so it stays idempotent if the processing task retries.This is the writer/in-process half of the cross-repo feature; the Go read path lives in getsentry/vroom#670 and the kafka message contract in sentry-kafka-schemas. Needs a vroomrs release + pin bump in sentry once it lands.