-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
(WIP) Mtopo27/size analysis docs #15256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 3 commits
defc5a6
0a0fbaa
a3fc8eb
6c472be
e136a63
935e91d
84c69b6
4bb7e6f
87195c4
896c120
abde456
633261f
b74e732
97371a3
a447287
269f074
589f484
f5591b1
a7827d7
5694751
07faf8d
9d4d068
b5759eb
a0d62d7
8ca5b1b
64a1819
467176b
4d0d075
80c7a04
823a889
a833c9f
75beead
bd7ffbd
ee1015c
b9a68f6
5485800
9a42ad1
1db4298
1244081
df9ee14
6a331fd
992f405
31d9785
fa0ed6c
6cedc29
97cf608
f0559e1
e0f91ce
b91ef9b
161c795
c12af86
cd9a844
bcab471
653bca6
68bfd75
3da246e
ba378f7
691e7b9
579ca3a
5b84ef2
c0432b7
e180436
838e5f3
ff1a6ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| --- | ||
| title: Size Analysis | ||
| sidebar_title: Size Analysis | ||
| sidebar_order: 5200 | ||
| description: Upload Android builds to Sentry for size analysis. | ||
| --- | ||
|
|
||
| Size Analysis uploads your Android builds so you can catch size regressions before they reach production. | ||
|
|
||
| <Include name="size-analysis/github-only" /> | ||
|
|
||
| ## Quick Start | ||
|
|
||
| <Include name="size-analysis/quickstart-intro" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-gradle" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-cli" /> | ||
|
|
||
| ## More Upload Basics | ||
|
|
||
| See [Uploading Builds](/product/size-analysis/uploading-builds/) for supported formats and required metadata. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --- | ||
| title: Size Analysis | ||
| sidebar_order: 5200 | ||
| description: Upload iOS builds to Sentry for size analysis. | ||
| --- | ||
|
|
||
| Size Analysis uploads your release builds so you can spot app-size regressions before shipping. | ||
|
|
||
| <Include name="size-analysis/github-only" /> | ||
|
|
||
| ## Quick Start | ||
|
|
||
| <Include name="size-analysis/quickstart-intro" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-fastlane" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-cli" /> | ||
|
|
||
| ## More Upload Basics | ||
|
|
||
| See [Uploading Builds](/product/size-analysis/uploading-builds/) for supported formats and required metadata. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| title: Size Analysis | ||
| sidebar_order: 5200 | ||
| description: Upload Flutter builds to Sentry for size analysis. | ||
| --- | ||
|
|
||
| Use Size Analysis to monitor how your Flutter app size changes across iOS and Android builds. | ||
|
|
||
| <Include name="size-analysis/github-only" /> | ||
|
|
||
| ## Quick Start | ||
|
|
||
| <Include name="size-analysis/quickstart-intro" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-fastlane" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-gradle" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-cli" /> | ||
|
|
||
| ## More Upload Basics | ||
|
|
||
| See [Uploading Builds](/product/size-analysis/uploading-builds/) for supported formats and required metadata. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| title: Size Analysis | ||
| sidebar_title: Size Analysis | ||
| sidebar_order: 5200 | ||
| description: Upload React Native iOS and Android builds to Sentry for size analysis. | ||
| --- | ||
|
|
||
| Size Analysis helps React Native teams compare app size across iOS and Android builds from the same pull request. | ||
|
|
||
| <Include name="size-analysis/github-only" /> | ||
|
|
||
| ## Quick Start | ||
|
|
||
| <Include name="size-analysis/quickstart-intro" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-fastlane" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-gradle" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-cli" /> | ||
|
|
||
| ## More Upload Basics | ||
|
|
||
| See [Uploading Builds](/product/size-analysis/uploading-builds/) for supported formats and required metadata. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| --- | ||
| title: GitHub Integration | ||
| sidebar_order: 40 | ||
| description: Set up the GitHub integration to receive size change notifications as PR comments and status checks. | ||
| --- | ||
|
|
||
| The GitHub integration brings Size Analysis directly into your pull request workflow by posting size change summaries as PR comments and status checks. | ||
|
|
||
| <Alert level="info"> | ||
| GitHub is currently the only supported VCS provider for Size Analysis. | ||
| </Alert> | ||
|
|
||
| ## Benefits | ||
|
|
||
| With the GitHub integration enabled, you get: | ||
|
|
||
| - **PR comments**: Automatic comments on pull requests showing size changes | ||
| - **Status checks**: Pass/fail checks based on size thresholds (coming soon) | ||
| - **Inline notifications**: See size impacts without leaving GitHub | ||
| - **Historical tracking**: Links to detailed comparisons in [sentry.io](https://sentry.io) | ||
|
|
||
| ## Installation | ||
|
|
||
| ### Install the Sentry GitHub App | ||
|
|
||
| The GitHub integration requires the Sentry GitHub App to be installed on your repository: | ||
|
|
||
| 1. Navigate to **Organization Settings > Integrations** in [sentry.io](https://sentry.io) | ||
| 2. Find the **GitHub** integration and click **Install** | ||
| 3. Follow the prompts to authorize the app for your GitHub organization | ||
| 4. Select the repositories where you want to enable Size Analysis | ||
|
|
||
| For detailed installation instructions, see the [GitHub integration documentation](https://docs.sentry.io/organization/integrations/source-code-mgmt/github/). | ||
|
|
||
| ### Configure Repository Access | ||
|
|
||
| Ensure the Sentry GitHub App has access to the repositories where you're uploading builds: | ||
|
|
||
| 1. Go to your GitHub organization settings | ||
| 2. Navigate to **Integrations > Applications** | ||
| 3. Click on **Sentry** | ||
| 4. Under **Repository access**, grant access to your repositories | ||
|
|
||
| ## How It Works | ||
|
|
||
| Once the integration is set up and you're uploading builds from your CI: | ||
|
|
||
| ### On Pull Requests | ||
|
|
||
| 1. **You open a PR**: Your CI builds the app and uploads it to Sentry | ||
| 2. **Base branch build**: Sentry finds the corresponding build from your base branch | ||
| 3. **Comparison**: Sentry compares the two builds | ||
| 4. **PR comment**: A comment is posted with the size change summary | ||
|
|
||
| ### Comment Content | ||
|
|
||
| The PR comment includes: | ||
|
|
||
| - **Total size change**: How much the app grew or shrank (for example, `+142 KB` or `-23 KB`) | ||
| - **Percentage change**: The relative impact (for example, `+2.3%`) | ||
| - **Component highlights**: The components that changed the most | ||
| - **Link to details**: A link to view the full comparison in [sentry.io](https://sentry.io) | ||
|
|
||
| ### Example PR Comment | ||
|
|
||
| ``` | ||
| ## 📊 Size Analysis | ||
|
|
||
| **App size changed by +142 KB (+2.3%)** | ||
|
|
||
| ### Largest Changes | ||
| - `Frameworks/MyFramework.framework`: +98 KB | ||
| - `Resources/Assets.car`: +52 KB | ||
| - `Binary`: -8 KB | ||
|
|
||
| [View detailed comparison →](https://sentry.io/...) | ||
| ``` | ||
|
|
||
| ## Requirements | ||
|
|
||
| For the GitHub integration to work with Size Analysis: | ||
|
|
||
| 1. **GitHub App installed**: The Sentry GitHub App must be installed on your repository | ||
| 2. **Builds from PRs**: You must upload builds from pull request CI runs | ||
| 3. **Base branch builds**: You must also upload builds from your main/base branch | ||
| 4. **Metadata**: Your build uploads must include PR metadata (auto-detected in GitHub Actions) | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Not Seeing PR Comments? | ||
|
|
||
| Check that: | ||
|
|
||
| - The Sentry GitHub App is installed and has access to your repository | ||
| - You're uploading builds from both PR branches and the base branch | ||
| - Your CI is running on pull request events | ||
| - The `SENTRY_AUTH_TOKEN` is set correctly in your CI environment | ||
| - Your builds have the same build configuration (for example, both are `Release` builds) | ||
|
|
||
| ### Comments Not Updating? | ||
|
|
||
| - Make sure you're uploading a new build after each code change | ||
| - Check that the build configuration matches between PR and base builds | ||
| - Verify that the PR metadata (PR number, base SHA) is being detected correctly | ||
|
|
||
| ### Missing Base Build? | ||
|
|
||
| The first time you set up Size Analysis, your main branch may not have any builds yet: | ||
|
|
||
| 1. Merge a PR or push to your main branch to trigger a build | ||
| 2. Future PRs will be able to compare against this base build | ||
|
|
||
| ## Permissions | ||
|
|
||
| The GitHub App requires these permissions: | ||
|
|
||
| - **Read access to code**: To identify the repository and branches | ||
| - **Write access to pull requests**: To post comments on PRs | ||
| - **Write access to checks**: To create status checks (coming soon) | ||
|
|
||
| These permissions are requested during the GitHub App installation flow. | ||
|
|
||
| ## Next Steps | ||
|
|
||
| - [Upload your first build](/product/size-analysis/uploading-builds/) to start seeing size analysis |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| --- | ||
| title: Size Analysis (Mobile) | ||
| sidebar_order: 136 | ||
| description: Track and optimize your mobile app's binary size with automated uploads, detailed breakdowns, and build comparisons. | ||
| --- | ||
|
|
||
| <Include name="size-analysis/ea" /> | ||
|
|
||
| Size Analysis helps you monitor and optimize your mobile application's binary size. By tracking your app size across builds and releases, you can catch unexpected size increases, understand what's contributing to your app's footprint, and deliver faster downloads for your users. | ||
|
|
||
| ## Why Track App Size? | ||
|
|
||
| Mobile app size directly impacts user acquisition and retention. Smaller apps: | ||
|
|
||
| - Download faster, reducing user drop-off during installation | ||
| - Take up less storage space on user devices | ||
| - Are more likely to be downloaded on slower networks | ||
| - Update more quickly, improving user experience | ||
|
|
||
| Size Analysis gives you visibility into your app's size trends and helps you catch regressions before they reach production. | ||
|
|
||
| ## How Size Analysis Works | ||
|
|
||
| ### Track Size Across Builds | ||
|
|
||
| Upload your iOS (`.xcarchive`, `.ipa`) or Android (`.aab`, `.apk`) builds to Sentry as part of your CI pipeline. Size Analysis automatically extracts size metrics and tracks changes over time. [Get started with automated uploads](/product/size-analysis/uploading-builds/). | ||
|
|
||
| ### Compare Builds | ||
|
|
||
| When you open a pull request, Size Analysis automatically compares your PR build against the base branch, showing you exactly how your changes impact app size. View the results directly in [sentry.io](https://sentry.io) or receive status checks in GitHub. | ||
|
|
||
| ### Understand Size Contributors | ||
|
|
||
| Use the treemap and breakdown views in Sentry to see which components, frameworks, and resources contribute most to your app size so you can identify optimization opportunities quickly. | ||
|
|
||
| ### Integrate with Your Workflow | ||
|
|
||
| Set up the [GitHub integration](/product/size-analysis/github-integration/) to receive size change notifications as PR comments and status checks, making size considerations a natural part of your code review process. | ||
|
|
||
| ## Supported Platforms | ||
|
|
||
| - **iOS**: XCArchive (`.xcarchive`) and IPA (`.ipa`) files | ||
| - **Android**: Android App Bundle (`.aab`, preferred) and APK (`.apk`) files | ||
|
|
||
| ## Requirements | ||
|
|
||
| To use Size Analysis, you need: | ||
|
|
||
| - A Sentry account with access to any [core plan](https://sentry.io/pricing/) | ||
| - A Sentry auth token for uploading builds | ||
| - GitHub as your VCS provider (currently the only supported provider) | ||
|
|
||
| ## Learn More | ||
|
|
||
| <PageGrid /> | ||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,37 @@ | ||||
| --- | ||||
| title: CLI Uploads | ||||
| sidebar_order: 30 | ||||
| description: Upload builds to Size Analysis with the Sentry CLI. | ||||
| --- | ||||
|
|
||||
| The Sentry CLI can be used to upload any [accepted mobile build type](/product/size-analysis/uploading-builds/#supported-build-formats). | ||||
|
|
||||
| Set your auth token and use the Sentry CLI to upload iOS or Android builds. | ||||
|
|
||||
| ## Set your auth token | ||||
|
|
||||
| ```bash | ||||
| export SENTRY_AUTH_TOKEN=your-token-here | ||||
|
||||
| export SENTRY_AUTH_TOKEN=your-token-here |
runningcode marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| --- | ||
| title: Fastlane Uploads | ||
| sidebar_order: 10 | ||
| description: Configure Size Analysis uploads for iOS projects using Fastlane. | ||
| --- | ||
|
|
||
| This assumes you already have the Sentry Fastlane plugin in your project. See the [Fastlane integration guide](https://docs.sentry.io/platforms/apple/guides/ios/upload-debug-symbols/fastlane/) for the full setup. | ||
|
|
||
| ## Install the plugin | ||
|
|
||
| ```ruby | ||
| bundle exec fastlane add_plugin fastlane-plugin-sentry | ||
| ``` | ||
|
|
||
runningcode marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Ensure the plugin version is `1.34.0` or higher. | ||
|
|
||
| ## Add a lane | ||
|
|
||
| ```ruby | ||
| lane :upload_to_sentry do | ||
| sentry_upload_build( | ||
| org_slug: 'your-org', | ||
| project_slug: 'your-project', | ||
| build_configuration: 'Release' # Adjust to your configuration | ||
| ) | ||
| end | ||
| ``` | ||
|
|
||
| If you already have a lane, add the `sentry_upload_build` action to it. | ||
|
|
||
| ## Set your auth token in GitHub Actions | ||
|
|
||
| ```yaml | ||
| env: | ||
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
| ``` | ||
runningcode marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Run the lane | ||
|
|
||
| ```bash | ||
| bundle exec fastlane upload_to_sentry | ||
| ``` | ||
|
|
||
| ## Next steps | ||
|
|
||
| - View the [Sentry Fastlane plugin documentation](https://github.com/getsentry/sentry-fastlane-plugin) for advanced options | ||
| - Return to the [Size Analysis upload overview](/product/size-analysis/uploading-builds/) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we mention something about the hybrids (RN, Flutter) that they also work through the native uploaded bundles?