Skip to content
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

feat(SR): Add SR to Mobile project onboarding features #87304

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 27 additions & 15 deletions static/app/components/onboarding/productSelection.tsx
Original file line number Diff line number Diff line change
@@ -76,8 +76,16 @@ function getDisabledProducts(organization: Organization): DisabledProducts {
// Since the ProductSelection component is rendered in the onboarding/project creation flow only, it is ok to have this list here
// NOTE: Please keep the prefix in alphabetical order
export const platformProductAvailability = {
android: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
'apple-ios': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
android: [
ProductSolution.PERFORMANCE_MONITORING,
ProductSolution.PROFILING,
ProductSolution.SESSION_REPLAY,
],
'apple-ios': [
ProductSolution.PERFORMANCE_MONITORING,
ProductSolution.PROFILING,
ProductSolution.SESSION_REPLAY,
],
'apple-macos': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
bun: [ProductSolution.PERFORMANCE_MONITORING],
capacitor: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.SESSION_REPLAY],
@@ -187,7 +195,11 @@ export const platformProductAvailability = {
'python-tornado': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
'python-starlette': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
'python-wsgi': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
'react-native': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
'react-native': [
ProductSolution.PERFORMANCE_MONITORING,
ProductSolution.PROFILING,
ProductSolution.SESSION_REPLAY,
],
ruby: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
'ruby-rack': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
'ruby-rails': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
@@ -391,18 +403,6 @@ export function ProductSelection({
checked={urlProducts.includes(ProductSolution.PERFORMANCE_MONITORING)}
/>
)}
{products.includes(ProductSolution.SESSION_REPLAY) && (
Copy link
Member Author

Choose a reason for hiding this comment

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

this changes the order of the product selection buttons (see PR description why)

  • from Tracing - Session Replay - Profiling
  • to Tracing - Profiling - Session Replay

we might want to reconsider this, not a strong opinion of mine :)

<Product
label={t('Session Replay')}
description={t(
'Video-like reproductions of user sessions with debugging context to help you confirm issue impact and troubleshoot faster.'
)}
docLink="https://docs.sentry.io/platforms/javascript/guides/react/session-replay/"
onClick={() => handleClickProduct(ProductSolution.SESSION_REPLAY)}
disabled={disabledProducts[ProductSolution.SESSION_REPLAY]}
checked={urlProducts.includes(ProductSolution.SESSION_REPLAY)}
/>
)}
{products.includes(ProductSolution.PROFILING) && (
<Product
label={t('Profiling')}
@@ -418,6 +418,18 @@ export function ProductSelection({
checked={urlProducts.includes(ProductSolution.PROFILING)}
/>
)}
{products.includes(ProductSolution.SESSION_REPLAY) && (
<Product
label={t('Session Replay')}
description={t(
'Video-like reproductions of user sessions with debugging context to help you confirm issue impact and troubleshoot faster.'
)}
docLink="https://docs.sentry.io/platforms/javascript/guides/react/session-replay/"
Copy link
Member

Choose a reason for hiding this comment

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

i know the other links are also platform-specific too, but curious why these links are platform-specific and not linking to the general product docs

Copy link
Member Author

Choose a reason for hiding this comment

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

good point - IMO makes sense to link to product docs for all of these (in a separate PR?)

Copy link
Member

Choose a reason for hiding this comment

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

works for me!

Copy link
Member Author

Choose a reason for hiding this comment

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

split it out to #87412

onClick={() => handleClickProduct(ProductSolution.SESSION_REPLAY)}
disabled={disabledProducts[ProductSolution.SESSION_REPLAY]}
checked={urlProducts.includes(ProductSolution.SESSION_REPLAY)}
/>
)}
</Products>
);
}
8 changes: 8 additions & 0 deletions static/app/gettingStartedDocs/android/android.tsx
Original file line number Diff line number Diff line change
@@ -88,6 +88,14 @@ const getConfigurationSnippet = (params: Params) => `
<!-- see https://docs.sentry.io/platforms/android/profiling/troubleshooting/ -->
<meta-data android:name="io.sentry.traces.profiling.sample-rate" android:value="1.0" />`
: ''
}${
params.isReplaySelected
? `

<!-- record session replays for 100% of errors and 10% of sessions -->
<meta-data android:name="io.sentry.session-replay.on-error-sample-rate" android:value="1.0" />
<meta-data android:name="io.sentry.session-replay.session-sample-rate" android:value="0.1" />`
: ''
}
</application>`;

20 changes: 20 additions & 0 deletions static/app/gettingStartedDocs/apple/ios.tsx
Original file line number Diff line number Diff line change
@@ -86,6 +86,16 @@ func application(_ application: UIApplication,
// We recommend adjusting this value in production.
options.profilesSampleRate = 1.0`
: ''
}${
params.isReplaySelected
? `

// Record Session Replays for 100% of Errors and 10% of Sessions
options.sessionReplay.onErrorSampleRate = 1.0
options.sessionReplay.sessionSampleRate = 0.1
// We recommend the ~5x more performant experimental view renderer
options.sessionReplay.enableExperimentalViewRenderer = true`
: ''
}
}${
params.isProfilingSelected &&
@@ -135,6 +145,16 @@ struct SwiftUIApp: App {
// We recommend adjusting this value in production.
options.profilesSampleRate = 1.0`
: ''
}${
params.isReplaySelected
? `

// Record Session Replays for 100% of Errors and 10% of Sessions
options.sessionReplay.onErrorSampleRate = 1.0
options.sessionReplay.sessionSampleRate = 0.1
// We recommend the ~5x more performant experimental view renderer
Copy link
Member Author

Choose a reason for hiding this comment

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

we need to decide if we want to point this out here. IMO we should, or we postpone this PR for iOS (and RN, see below)

Copy link
Member

Choose a reason for hiding this comment

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

Make sense to me as well.

options.sessionReplay.enableExperimentalViewRenderer = true`
: ''
}
}${
params.isProfilingSelected &&
8 changes: 8 additions & 0 deletions static/app/gettingStartedDocs/react-native/react-native.tsx
Original file line number Diff line number Diff line change
@@ -73,6 +73,14 @@ Sentry.init({
// Here, we'll capture profiles for 100% of transactions.
profilesSampleRate: 1.0,`
: ''
}${
params.isReplaySelected
? `
// Record Session Replays for 10% of Sessions and 100% of Errors
Copy link
Member Author

Choose a reason for hiding this comment

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

RN will have the enableExperimentalViewRenderer option soon (PR in review), same considerations as for iOS (see https://github.com/getsentry/sentry/pull/87304/files#r2001723725) apply

replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
integrations: [Sentry.mobileReplayIntegration()],`
: ''
}
});`;