docs: Add develop-docs with Perfetto profiling documentation - #5750
docs: Add develop-docs with Perfetto profiling documentation#5750markushi wants to merge 3 commits into
Conversation
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>
📲 Install BuildsAndroid
|
runningcode
left a comment
There was a problem hiding this comment.
Looks good to me! I only reviewed the README.md in detail.
|
|
||
| ### File naming | ||
|
|
||
| - File names are **lowercase**. |
There was a problem hiding this comment.
this one is README.md though?
|
|
||
| ### Directory structure | ||
|
|
||
| - Use a **flat directory structure** for all markdown files, they live live directly in `develop-docs/`. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
link to what Relay is? (im not familiar with it)
| 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 |
0xadam-brown
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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:
- Surface area we collect against (ie, where or when do we collect data)
- How we collect the data
- Format of the collected data
- 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.)
|
|
||
| ### Directory structure | ||
|
|
||
| - Use a **flat directory structure** for all markdown files, they live live directly in `develop-docs/`. |
There was a problem hiding this comment.
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.
|
|
||
| ### Directory structure | ||
|
|
||
| - Use a **flat directory structure** for all markdown files, they live live directly in `develop-docs/`. |
There was a problem hiding this comment.
| - 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/`. |
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 viaandroid.os.ProfilingManager, themeta_lengthenvelope 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