Skip to content

Conversation

@philprime
Copy link
Member

@philprime philprime commented Mar 17, 2025

DESCRIBE YOUR PR

The current configuration docs display an example usage of the SentrySDK.startProfiler() and SentrySDK.stopProfiler() and mentions that the call of stop is optional, as the profiler will automatically stop when going to the background.

Now if a user calls SentrySDK.startProfiler() in the didFinishLaunching hook, which is only called once per app start, the profiler would stop when the app goes to the first going to the background and not start again.

I would like to propose/discuss if the SentrySDK.startProfiler() should be used in applicationDidBecomeActive(_:) too.

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

cc @jas-kas

@vercel
Copy link

vercel bot commented Mar 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs 🛑 Canceled (Inspect) Mar 17, 2025 1:48pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
changelog ⬜️ Ignored (Inspect) Mar 17, 2025 1:48pm
develop-docs ⬜️ Ignored (Inspect) Visit Preview Mar 17, 2025 1:48pm

@codecov
Copy link

codecov bot commented Mar 17, 2025

Bundle Report

Changes will decrease total bundle size by 15 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 10.54MB -9 bytes (-0.0%) ⬇️
sentry-docs-client-array-push 9.39MB -6 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 868.16kB -0.0%
static/chunks/3319-*.js -3 bytes 393.41kB -0.0%
server/middleware-*.js 5.55kB 6.55kB 555.3% ⚠️
server/middleware-*.js -5.55kB 1.0kB -84.74%
static/KLbEAcNiZ4WmLkMk25tpG/_buildManifest.js (New) 578 bytes 578 bytes 100.0% 🚀
static/KLbEAcNiZ4WmLkMk25tpG/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/T4E5Oc9bbppZcXlyGt30N/_buildManifest.js (Deleted) -578 bytes 0 bytes -100.0% 🗑️
static/T4E5Oc9bbppZcXlyGt30N/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.57MB -0.0%
../instrumentation.js -3 bytes 904.32kB -0.0%
9523.js -3 bytes 880.37kB -0.0%

@philprime
Copy link
Member Author

@armcknight it would be great if you could add some insights if these changes makes sense

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

I'm not sure if this change makes sense. @armcknight what do you think?

Comment on lines +126 to +128
func applicationDidBecomeActive(_ application: UIApplication) {
SentrySDK.startProfiler()
}
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if this doesn't add too much noise. We already mention SentrySDK.startProfiler() above and tell the user that they have to manually start and stop the profiler.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree that this is duplicate text. I am questioning the value of displaying the SentrySDK.startProfile() in the didFinishLaunch method alltogether.

@philprime
Copy link
Member Author

I actually just noticed that the Apple Documentation states the following:

If you’re using scenes (see Scenes), UIKit will not call this method. Use sceneDidBecomeActive(_:) instead to restart any tasks or refresh your app’s user interface. UIKit posts a didBecomeActiveNotification regardless of whether your app uses scenes.

AFAIK scenes are the default for creating new Xcode projects, so maybe we should also mention sceneDidBecomeActive for the SceneDelegate

Copy link
Contributor

@kahest kahest left a comment

Choose a reason for hiding this comment

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

@philprime this is probably superseded by #13197 - in general I think we're moving away from showing start/stopProfiler on this page completely

@philprime
Copy link
Member Author

Closing in favor of #13197

@philprime philprime closed this Apr 8, 2025
@github-project-automation github-project-automation bot moved this from Needs Review to Done in [DEPRECATED] Mobile SDKs Apr 8, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Apr 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants