Skip to content

docs: Add develop-docs with Perfetto profiling documentation - #5750

Open
markushi wants to merge 3 commits into
mainfrom
feat/develop-docs
Open

docs: Add develop-docs with Perfetto profiling documentation#5750
markushi wants to merge 3 commits into
mainfrom
feat/develop-docs

Conversation

@markushi

@markushi markushi commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

Introduces a develop-docs/ folder for internal developer documentation.

  • README.md — defines the documentation conventions: flat directory structure with filename prefixes (general-, feature-, integration-, platform-, process-), lowercase dash-separated names, same-named folders for embedded assets, present-tense/active-voice writing, and Mermaid for diagrams.
  • feature-perfetto-profiling.md — first feature doc, covering the Android Perfetto continuous-profiling pipeline end to end: capturing profile chunks via android.os.ProfilingManager, the meta_length envelope framing, Relay's Perfetto → Sample v2 conversion and object-store routing, and the monolith's storage, serving, and download endpoints.

#skip-changelog

🤖 Generated with Claude Code

markushi and others added 2 commits July 9, 2026 11:20
Introduce a develop-docs folder for internal developer documentation, with a
README defining the docs conventions (flat structure, prefixes, naming, images,
Mermaid) and a first feature doc covering the Android Perfetto profiling pipeline
from the SDK through Relay to the monolith.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sentry

sentry Bot commented Jul 9, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I only reviewed the README.md in detail.

Comment thread develop-docs/README.md

### File naming

- File names are **lowercase**.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is README.md though?

Comment thread develop-docs/README.md

### Directory structure

- Use a **flat directory structure** for all markdown files, they live live directly in `develop-docs/`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im wondering if a flat structure makes sense given that the repo has so many different modules and areas of concern like java/android/sprint/etc?

but i agree that it is best to start flat and then re-organize later if necessary.

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.

My vote would be to convert the file prefix convention to subdirectories from the get-go. I'd also favor using subdirectories liberally b/c they encourage organization + could lead to less context bloat for LLMs.

Eg, a fully-fleshed out directory tree for profiling might look like this:

/developdocs
  /feature
    /profiling
      profiling-overview.md
      /types
        /transaction
          transaction-profiling.md
        /continuous
          trace-profiling.md
          perfetto-profiling.md
        /anr
          anr-profiling.md
      /pipeline
        profiling-pipeline.md // Describes the backend profiling pipeline.
      /symbolication
        deobfuscating-profiles.md
      ...

If we really plan to make use of develop-docs, hierarchical organization will pay off quickly.

## Pipeline overview

A profile chunk is captured on the device, embedded into a Sentry envelope, expanded and
routed by Relay, and finally symbolicated and stored by the monolith so it can be served

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link to what Relay is? (im not familiar with it)

Comment thread develop-docs/README.md
that don't belong in the public [Sentry docs](https://docs.sentry.io) or in inline
code comments.

If you are documenting **how** or **why** something works for the people who maintain

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@markushi
markushi marked this pull request as ready for review July 21, 2026 14:23

@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 for this @markushi 💯 !

A few comments for your consideration; no blockers.


## What Perfetto is

[Perfetto](https://perfetto.dev/) is Android's system-wide tracing stack. Its

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.

nit if you want it: "Perfetto is Google's preferred tracing framework for Android" (or something like that).

(Took me a few clicks to figure out how to interpret "system" and "stack", as they could mean a few things and my first guesses were wrong.)

- Trace format (`TracePacket` proto): https://perfetto.dev/docs/reference/trace-packet-proto
- Perfetto UI (to open a downloaded `.pftrace`): https://ui.perfetto.dev/

## Pipeline overview

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.

m (non-blocking): My vote would be to create a separate .md file that discusses the pipeline at a high level. We could reference it from here + describe any quirks Perfetto profiling introduces.

That'd let us explain the pipeline clearly on its own terms + share the discussion across .md files for different profiling types (Perfetto, ANR, etc.). I suspect we'll find that giving folks are clear theory of the pipeline ends up being the most helpful artifact going forward, esp as new profiling types will either need to feed into the pipeline's existing format expectations or require updating those expectations.


Generalizing...

Taking a step back, I expect we'll see the following pattern a lot in the develop-docs we use to explain systems / features / integrations:

  1. Surface area we collect against (ie, where or when do we collect data)
  2. How we collect the data
  3. Format of the collected data
  4. Backend pipeline (input format expectations Relay expects + output format(s) Relay publishes; major components / services on the write path; major components / services on the read path)

Repeating that framework where it makes sense could be a consistency win. Eg, we could include feature overview .md file that summarizes (1); a more specific .md file could describe (2) - (3) on a per-type basis (eg, perfetto-profiling.md, anr-profiling.md); and a pipeline .md file could capture (4).

Anything not relevant to a particular feature could be omitted, and discussions could be kept as high-level as possible to keep them fresh longer. (Eg, no need to repeat data formats in detail; but mentioning the fact that, say, Perfetto generates protobuf traces is helpful, as is the fact that Relay publishes two formats for continuous profile chunks which all downstream services need to care about, etc.)

Comment thread develop-docs/README.md

### Directory structure

- Use a **flat directory structure** for all markdown files, they live live directly in `develop-docs/`.

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.

My vote would be to convert the file prefix convention to subdirectories from the get-go. I'd also favor using subdirectories liberally b/c they encourage organization + could lead to less context bloat for LLMs.

Eg, a fully-fleshed out directory tree for profiling might look like this:

/developdocs
  /feature
    /profiling
      profiling-overview.md
      /types
        /transaction
          transaction-profiling.md
        /continuous
          trace-profiling.md
          perfetto-profiling.md
        /anr
          anr-profiling.md
      /pipeline
        profiling-pipeline.md // Describes the backend profiling pipeline.
      /symbolication
        deobfuscating-profiles.md
      ...

If we really plan to make use of develop-docs, hierarchical organization will pay off quickly.

Comment thread develop-docs/README.md

### Directory structure

- Use a **flat directory structure** for all markdown files, they live live directly in `develop-docs/`.

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.

Suggested change
- Use a **flat directory structure** for all markdown files, they live live directly in `develop-docs/`.
- Use a **flat directory structure** for all markdown files, they live directly in `develop-docs/`.

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.

3 participants