From 577ecb0cf975c94eaf199110cd1d146f97788948 Mon Sep 17 00:00:00 2001 From: Karl Heinz Struggl Date: Thu, 19 Dec 2024 18:27:47 +0100 Subject: [PATCH 1/2] fixes duplicate feature descriptions --- docs/platforms/android/index.mdx | 2 -- docs/platforms/apple/common/index.mdx | 2 -- 2 files changed, 4 deletions(-) diff --git a/docs/platforms/android/index.mdx b/docs/platforms/android/index.mdx index fa10c726d5718..52b39b1be027c 100644 --- a/docs/platforms/android/index.mdx +++ b/docs/platforms/android/index.mdx @@ -49,8 +49,6 @@ Select which Sentry features you'd like to install in addition to Error Monitori Sentry captures data by using an SDK within your application's runtime. These are platform-specific and allow Sentry to have a deep understanding of how your application works. -In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](https://docs.sentry.io/concepts/key-terms/tracing/). You can also collect and analyze performance profiles from real users with [profiling](https://docs.sentry.io/product/explore/profiling/). To enable tracing and/or profiling, click the corresponding checkmarks to get the code snippets. - We recommend installing the SDK through our [Sentry Wizard](https://github.com/getsentry/sentry-wizard) by running the following command inside your project directory: ```bash diff --git a/docs/platforms/apple/common/index.mdx b/docs/platforms/apple/common/index.mdx index 8c357e9873029..3c7d1d8aea887 100644 --- a/docs/platforms/apple/common/index.mdx +++ b/docs/platforms/apple/common/index.mdx @@ -34,8 +34,6 @@ Select which Sentry features you'd like to install in addition to Error Monitori Sentry captures data by using an SDK within your application's runtime. These are platform-specific and allow Sentry to have a deep understanding of how your application works. -In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](https://docs.sentry.io/concepts/key-terms/tracing/). You can also collect and analyze performance profiles from real users with [profiling](https://docs.sentry.io/product/profiling/). To enable tracing and/or profiling, click the corresponding checkmarks to get the code snippets. - We recommend installing the SDK with Swift Package Manager (SPM), but we also support alternate [installation methods](install/). To integrate Sentry into your Xcode project, open your App in Xcode and open **File > Add Packages**. Then add the SDK by entering the git repo url in the top right search field: From baf78b3ed15fc9341bf36e647544d5f1229a499b Mon Sep 17 00:00:00 2001 From: Karl Heinz Struggl Date: Thu, 19 Dec 2024 18:48:48 +0100 Subject: [PATCH 2/2] fix snippets, show profiling only where supported --- docs/platforms/apple/common/index.mdx | 126 +++++++++++++++++++++----- 1 file changed, 101 insertions(+), 25 deletions(-) diff --git a/docs/platforms/apple/common/index.mdx b/docs/platforms/apple/common/index.mdx index 3c7d1d8aea887..78ba49ba5e5be 100644 --- a/docs/platforms/apple/common/index.mdx +++ b/docs/platforms/apple/common/index.mdx @@ -18,19 +18,34 @@ The support for [visionOS](https://developer.apple.com/visionos/) is currently e ## Features + + In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](/concepts/key-terms/tracing/). You can also collect and analyze performance profiles from real users with [profiling](/product/explore/profiling/). + + + + +In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](/concepts/key-terms/tracing/). + + + Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below. ## Install - + + + + + + + + + + + + Sentry captures data by using an SDK within your application's runtime. These are platform-specific and allow Sentry to have a deep understanding of how your application works. @@ -70,8 +85,9 @@ If you prefer, you can also [set up the SDK manually](/platforms/apple/guides/io To capture all errors, initialize the SDK as soon as possible, such as in your `AppDelegate` `application:didFinishLaunchingWithOptions` method: + -```swift {tabTitle:Swift} {"onboardingOptions": {"performance": "9-12", "profiling": "13-16"}} +```swift {tabTitle:Swift} {"onboardingOptions": {"performance": "9-12", "profiling": "14-24"}} import Sentry func application(_ application: UIApplication, @@ -86,22 +102,22 @@ func application(_ application: UIApplication, options.tracesSampleRate = 1.0 } - // Manually call startProfiler and stopProfiler to profile any code that runs in between. - SentrySDK.startProfiler() + // Manually call startProfiler and stopProfiler to profile any code that runs in between. + SentrySDK.startProfiler() - // - // ...anything here will be profiled... - // + // + // ...anything here will be profiled... + // - // Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling - // your application until the process exits, the app goes to the background, or stopProfiling is called. - SentrySDK.stopProfiler() + // Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling + // your application until the process exits, the app goes to the background, or stopProfiling is called. + SentrySDK.stopProfiler() return true } ``` -```objc {tabTitle:Objective-C} {"onboardingOptions": {"performance": "8-11", "profiling": "12-15"}} +```objc {tabTitle:Objective-C} {"onboardingOptions": {"performance": "8-11", "profiling": "13-23"}} @import Sentry; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { @@ -115,16 +131,16 @@ func application(_ application: UIApplication, options.tracesSampleRate = @1.0; }]; - // Manually call startProfiler and stopProfiler to profile any code that runs in between. - [SentrySDK startProfiler]; + // Manually call startProfiler and stopProfiler to profile any code that runs in between. + [SentrySDK startProfiler]; - // - // ...anything here will be profiled... - // + // + // ...anything here will be profiled... + // - // Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling - // your application until the process exits, the app goes to the background, or stopProfiling is called. - [SentrySDK stopProfiler]; + // Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling + // your application until the process exits, the app goes to the background, or stopProfiling is called. + [SentrySDK stopProfiler]; return YES; } @@ -151,6 +167,66 @@ struct SwiftUIApp: App { } } ``` + + + + +```swift {tabTitle:Swift} {"onboardingOptions": {"performance": "9-12"}} +import Sentry + +func application(_ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + + SentrySDK.start { options in + options.dsn = "___PUBLIC_DSN___" + options.debug = true // Enabled debug when first installing is always helpful + + // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring. + // We recommend adjusting this value in production. + options.tracesSampleRate = 1.0 + } + + return true +} +``` + +```objc {tabTitle:Objective-C} {"onboardingOptions": {"performance": "8-11"}} +@import Sentry; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + + [SentrySDK startWithConfigureOptions:^(SentryOptions *options) { + options.dsn = @"___PUBLIC_DSN___"; + options.debug = YES; // Enabled debug when first installing is always helpful + + // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring. + // We recommend adjusting this value in production. + options.tracesSampleRate = @1.0; + }]; + + return YES; +} +``` + +```swift {tabTitle:SwiftUI with App conformer} {"onboardingOptions": {"performance": "9-12"}} +import Sentry + +@main +struct SwiftUIApp: App { + init() { + SentrySDK.start { options in + options.dsn = "___PUBLIC_DSN___" + options.debug = true // Enabled debug when first installing is always helpful + + // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring. + // We recommend adjusting this value in production. + options.tracesSampleRate = 1.0 + } + } +} +``` + + ## Verify