Browse Source

chore(onboarding): Update dotnet onboarding to include profiling (#68104)

Dotnet supports profiling. Include it in the onboarding along with the
product selection.
Tony Xiao 10 months ago
parent
commit
f56c846d50

+ 13 - 0
static/app/components/onboarding/productSelection.tsx

@@ -77,6 +77,19 @@ function getDisabledProducts(organization: Organization): DisabledProducts {
 export const platformProductAvailability = {
 export const platformProductAvailability = {
   android: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
   android: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
   bun: [ProductSolution.PERFORMANCE_MONITORING],
   bun: [ProductSolution.PERFORMANCE_MONITORING],
+  dotnet: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
+  'dotnet-aspnet': [ProductSolution.PERFORMANCE_MONITORING],
+  'dotnet-aspnetcore': [
+    ProductSolution.PERFORMANCE_MONITORING,
+    ProductSolution.PROFILING,
+  ],
+  'dotnet-awslambda': [ProductSolution.PERFORMANCE_MONITORING],
+  'dotnet-gcpfunctions': [ProductSolution.PERFORMANCE_MONITORING],
+  'dotnet-maui': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
+  'dotnet-uwp': [ProductSolution.PERFORMANCE_MONITORING],
+  'dotnet-winforms': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
+  'dotnet-wpf': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
+  'dotnet-xamarin': [ProductSolution.PERFORMANCE_MONITORING],
   flutter: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
   flutter: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
   kotlin: [ProductSolution.PERFORMANCE_MONITORING],
   kotlin: [ProductSolution.PERFORMANCE_MONITORING],
   go: [ProductSolution.PERFORMANCE_MONITORING],
   go: [ProductSolution.PERFORMANCE_MONITORING],

+ 13 - 1
static/app/gettingStartedDocs/dotnet/aspnet.spec.tsx

@@ -2,10 +2,12 @@ import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboa
 import {screen} from 'sentry-test/reactTestingLibrary';
 import {screen} from 'sentry-test/reactTestingLibrary';
 import {textWithMarkupMatcher} from 'sentry-test/utils';
 import {textWithMarkupMatcher} from 'sentry-test/utils';
 
 
+import {ProductSolution} from 'sentry/components/onboarding/productSelection';
+
 import docs from './aspnet';
 import docs from './aspnet';
 
 
 describe('aspnet onboarding docs', function () {
 describe('aspnet onboarding docs', function () {
-  it('renders docs correctly', async function () {
+  it('renders errors onboarding docs correctly', async function () {
     renderWithOnboardingLayout(docs, {
     renderWithOnboardingLayout(docs, {
       releaseRegistry: {
       releaseRegistry: {
         'sentry.dotnet.aspnet': {
         'sentry.dotnet.aspnet': {
@@ -27,4 +29,14 @@ describe('aspnet onboarding docs', function () {
       )
       )
     ).toBeInTheDocument();
     ).toBeInTheDocument();
   });
   });
+
+  it('renders performance onboarding docs correctly', async function () {
+    renderWithOnboardingLayout(docs, {
+      selectedProducts: [ProductSolution.PERFORMANCE_MONITORING],
+    });
+
+    expect(
+      await screen.findByText(textWithMarkupMatcher(/o.TracesSampleRate/))
+    ).toBeInTheDocument();
+  });
 });
 });

+ 6 - 16
static/app/gettingStartedDocs/dotnet/aspnet.tsx

@@ -1,7 +1,5 @@
 import {Fragment} from 'react';
 import {Fragment} from 'react';
-import styled from '@emotion/styled';
 
 
-import {Alert} from 'sentry/components/alert';
 import ExternalLink from 'sentry/components/links/externalLink';
 import ExternalLink from 'sentry/components/links/externalLink';
 import List from 'sentry/components/list';
 import List from 'sentry/components/list';
 import ListItem from 'sentry/components/list/listItem';
 import ListItem from 'sentry/components/list/listItem';
@@ -57,11 +55,15 @@ public class MvcApplication : HttpApplication
             o.AddAspNet();
             o.AddAspNet();
             o.Dsn = "${params.dsn}";
             o.Dsn = "${params.dsn}";
             // When configuring for the first time, to see what the SDK is doing:
             // When configuring for the first time, to see what the SDK is doing:
-            o.Debug = true;
+            o.Debug = true;${
+              params.isPerformanceSelected
+                ? `
             // Set TracesSampleRate to 1.0 to capture 100%
             // Set TracesSampleRate to 1.0 to capture 100%
             // of transactions for performance monitoring.
             // of transactions for performance monitoring.
             // We recommend adjusting this value in production
             // We recommend adjusting this value in production
-            o.TracesSampleRate = 1.0;
+            o.TracesSampleRate = 1.0;`
+                : ''
+            }
             // If you are using EF (and installed the NuGet package):
             // If you are using EF (and installed the NuGet package):
             o.AddEntityFramework();
             o.AddEntityFramework();
         });
         });
@@ -109,14 +111,6 @@ const onboarding: OnboardingConfig = {
           code: getInstallSnippetEntityFramework(params),
           code: getInstallSnippetEntityFramework(params),
         },
         },
       ],
       ],
-      additionalInfo: (
-        <AlertWithoutMarginBottom type="info">
-          {tct(
-            '[strong:Using .NET Framework prior to 4.6.1?] Our legacy SDK supports .NET Framework as early as 3.5.',
-            {strong: <strong />}
-          )}
-        </AlertWithoutMarginBottom>
-      ),
     },
     },
   ],
   ],
   configure: params => [
   configure: params => [
@@ -231,7 +225,3 @@ const docs: Docs = {
 };
 };
 
 
 export default docs;
 export default docs;
-
-const AlertWithoutMarginBottom = styled(Alert)`
-  margin-bottom: 0;
-`;

+ 26 - 1
static/app/gettingStartedDocs/dotnet/aspnetcore.spec.tsx

@@ -2,10 +2,12 @@ import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboa
 import {screen} from 'sentry-test/reactTestingLibrary';
 import {screen} from 'sentry-test/reactTestingLibrary';
 import {textWithMarkupMatcher} from 'sentry-test/utils';
 import {textWithMarkupMatcher} from 'sentry-test/utils';
 
 
+import {ProductSolution} from 'sentry/components/onboarding/productSelection';
+
 import docs from './aspnetcore';
 import docs from './aspnetcore';
 
 
 describe('aspnetcore onboarding docs', function () {
 describe('aspnetcore onboarding docs', function () {
-  it('renders docs correctly', async function () {
+  it('renders errors onboarding docs correctly', async function () {
     renderWithOnboardingLayout(docs, {
     renderWithOnboardingLayout(docs, {
       releaseRegistry: {
       releaseRegistry: {
         'sentry.dotnet.aspnetcore': {
         'sentry.dotnet.aspnetcore': {
@@ -30,4 +32,27 @@ describe('aspnetcore onboarding docs', function () {
       )
       )
     ).toBeInTheDocument();
     ).toBeInTheDocument();
   });
   });
+
+  it('renders performance onboarding docs correctly', async function () {
+    renderWithOnboardingLayout(docs, {
+      selectedProducts: [ProductSolution.PERFORMANCE_MONITORING],
+    });
+
+    expect(
+      await screen.findByText(textWithMarkupMatcher(/o.TracesSampleRate/))
+    ).toBeInTheDocument();
+  });
+
+  it('renders profiling onboarding docs correctly', async function () {
+    renderWithOnboardingLayout(docs, {
+      selectedProducts: [
+        ProductSolution.PERFORMANCE_MONITORING,
+        ProductSolution.PROFILING,
+      ],
+    });
+
+    expect(
+      await screen.findByText(textWithMarkupMatcher(/o.ProfilesSampleRate/))
+    ).toBeInTheDocument();
+  });
 });
 });

+ 84 - 24
static/app/gettingStartedDocs/dotnet/aspnetcore.tsx

@@ -25,14 +25,28 @@ const getInstallSnippetPackageManager = (params: Params) => `
 Install-Package Sentry.AspNetCore -Version ${getPackageVersion(
 Install-Package Sentry.AspNetCore -Version ${getPackageVersion(
   params,
   params,
   'sentry.dotnet.aspnetcore',
   'sentry.dotnet.aspnetcore',
-  '3.34.0'
+  params.isProfilingSelected ? '4.3.0' : '3.34.0'
 )}`;
 )}`;
 
 
 const getInstallSnippetCoreCli = (params: Params) => `
 const getInstallSnippetCoreCli = (params: Params) => `
 dotnet add package Sentry.AspNetCore -v ${getPackageVersion(
 dotnet add package Sentry.AspNetCore -v ${getPackageVersion(
   params,
   params,
   'sentry.dotnet.aspnetcore',
   'sentry.dotnet.aspnetcore',
-  '3.34.0'
+  params.isProfilingSelected ? '4.3.0' : '3.34.0'
+)}`;
+
+const getInstallProfilingSnippetPackageManager = (params: Params) => `
+Install-Package Sentry.Profiling -Version ${getPackageVersion(
+  params,
+  'sentry.dotnet.profiling',
+  '4.3.0'
+)}`;
+
+const getInstallProfilingSnippetCoreCli = (params: Params) => `
+dotnet add package Sentry.Profiling -v ${getPackageVersion(
+  params,
+  'sentry.dotnet.profiling',
+  '4.3.0'
 )}`;
 )}`;
 
 
 const getConfigureSnippet = (params: Params) => `
 const getConfigureSnippet = (params: Params) => `
@@ -45,10 +59,32 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
           {
           {
               o.Dsn = "${params.dsn}";
               o.Dsn = "${params.dsn}";
               // When configuring for the first time, to see what the SDK is doing:
               // When configuring for the first time, to see what the SDK is doing:
-              o.Debug = true;
-              // Set TracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
+              o.Debug = true;${
+                params.isPerformanceSelected
+                  ? `
+              // Set TracesSampleRate to 1.0 to capture 100%
+              // of transactions for performance monitoring.
+              // We recommend adjusting this value in production
+              o.TracesSampleRate = 1.0;`
+                  : ''
+              }${
+                params.isProfilingSelected
+                  ? `
+              // Sample rate for profiling, applied on top of othe TracesSampleRate,
+              // e.g. 0.2 means we want to profile 20 % of the captured transactions.
               // We recommend adjusting this value in production.
               // We recommend adjusting this value in production.
-              o.TracesSampleRate = 1.0;
+              o.ProfilesSampleRate = 1.0;
+              // Requires NuGet package: Sentry.Profiling
+              // Note: By default, the profiler is initialized asynchronously. This can
+              // be tuned by passing a desired initialization timeout to the constructor.
+              o.AddIntegration(new ProfilingIntegration(
+                  // During startup, wait up to 500ms to profile the app startup code.
+                  // This could make launching the app a bit slower so comment it out if you
+                  // prefer profiling to start asynchronously.
+                  TimeSpan.FromMilliseconds(500)
+              ));`
+                  : ''
+              }
           });
           });
       });`;
       });`;
 
 
@@ -106,6 +142,26 @@ const onboarding: OnboardingConfig = {
             },
             },
           ],
           ],
         },
         },
+        ...(params.isProfilingSelected
+          ? [
+              {
+                code: [
+                  {
+                    language: 'shell',
+                    label: 'Package Manager',
+                    value: 'packageManager',
+                    code: getInstallProfilingSnippetPackageManager(params),
+                  },
+                  {
+                    language: 'shell',
+                    label: '.NET Core CLI',
+                    value: 'coreCli',
+                    code: getInstallProfilingSnippetCoreCli(params),
+                  },
+                ],
+              },
+            ]
+          : []),
       ],
       ],
     },
     },
   ],
   ],
@@ -127,7 +183,7 @@ const onboarding: OnboardingConfig = {
       ],
       ],
     },
     },
   ],
   ],
-  verify: () => [
+  verify: params => [
     {
     {
       type: StepType.VERIFY,
       type: StepType.VERIFY,
       description: t('To verify your set up, you can capture a message with the SDK:'),
       description: t('To verify your set up, you can capture a message with the SDK:'),
@@ -147,24 +203,28 @@ const onboarding: OnboardingConfig = {
         }
         }
       ),
       ),
     },
     },
-    {
-      title: t('Performance Monitoring'),
-      description: tct(
-        'You can measure the performance of your endpoints by adding a middleware to [code:Startup.cs]:',
-        {
-          code: <code />,
-        }
-      ),
-      configurations: [
-        {
-          description: t(
-            "You'll be able to monitor the performance of your actions automatically. To add additional spans to it, you can use the API:"
-          ),
-          language: 'csharp',
-          code: getPerformanceSpansSnippet(),
-        },
-      ],
-    },
+    ...(params.isPerformanceSelected
+      ? [
+          {
+            title: t('Performance Monitoring'),
+            description: tct(
+              'You can measure the performance of your endpoints by adding a middleware to [code:Startup.cs]:',
+              {
+                code: <code />,
+              }
+            ),
+            configurations: [
+              {
+                description: t(
+                  "You'll be able to monitor the performance of your actions automatically. To add additional spans to it, you can use the API:"
+                ),
+                language: 'csharp',
+                code: getPerformanceSpansSnippet(),
+              },
+            ],
+          },
+        ]
+      : []),
     {
     {
       title: t('Samples'),
       title: t('Samples'),
       description: (
       description: (

+ 13 - 1
static/app/gettingStartedDocs/dotnet/awslambda.spec.tsx

@@ -2,10 +2,12 @@ import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboa
 import {screen} from 'sentry-test/reactTestingLibrary';
 import {screen} from 'sentry-test/reactTestingLibrary';
 import {textWithMarkupMatcher} from 'sentry-test/utils';
 import {textWithMarkupMatcher} from 'sentry-test/utils';
 
 
+import {ProductSolution} from 'sentry/components/onboarding/productSelection';
+
 import docs from './awslambda';
 import docs from './awslambda';
 
 
 describe('awslambda onboarding docs', function () {
 describe('awslambda onboarding docs', function () {
-  it('renders docs correctly', async function () {
+  it('renders errors onboarding docs correctly', async function () {
     renderWithOnboardingLayout(docs, {
     renderWithOnboardingLayout(docs, {
       releaseRegistry: {
       releaseRegistry: {
         'sentry.dotnet.aspnetcore': {
         'sentry.dotnet.aspnetcore': {
@@ -26,4 +28,14 @@ describe('awslambda onboarding docs', function () {
       )
       )
     ).toBeInTheDocument();
     ).toBeInTheDocument();
   });
   });
+
+  it('renders performance onboarding docs correctly', async function () {
+    renderWithOnboardingLayout(docs, {
+      selectedProducts: [ProductSolution.PERFORMANCE_MONITORING],
+    });
+
+    expect(
+      await screen.findByText(textWithMarkupMatcher(/o.TracesSampleRate/))
+    ).toBeInTheDocument();
+  });
 });
 });

+ 13 - 7
static/app/gettingStartedDocs/dotnet/awslambda.tsx

@@ -46,10 +46,14 @@ public class LambdaEntryPoint : Amazon.Lambda.AspNetCoreServer.APIGatewayProxyFu
               // When configuring for the first time, to see what the SDK is doing:
               // When configuring for the first time, to see what the SDK is doing:
               o.Debug = true;
               o.Debug = true;
               // Required in Serverless environments
               // Required in Serverless environments
-              o.FlushOnCompletedRequest = true;
+              o.FlushOnCompletedRequest = true;${
+                params.isPerformanceSelected
+                  ? `
               // Set TracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
               // Set TracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
-                // We recommend adjusting this value in production.
-              o.TracesSampleRate = 1.0;
+              // We recommend adjusting this value in production.
+              o.TracesSampleRate = 1.0;`
+                  : ''
+              }
             })
             })
             .UseStartup<Startup>();
             .UseStartup<Startup>();
     }
     }
@@ -93,11 +97,13 @@ const onboarding: OnboardingConfig = {
             },
             },
           ],
           ],
         },
         },
+        {
+          description: tct(
+            'You can combine this integration with a logging library like [strong:log4net, NLog, or Serilog] to include both request data as well as your logs as breadcrumbs. The logging ingrations also capture events when an error is logged.',
+            {strong: <strong />}
+          ),
+        },
       ],
       ],
-      additionalInfo: tct(
-        'You can combine this integration with a logging library like [strong:log4net, NLog, or Serilog] to include both request data as well as your logs as breadcrumbs. The logging ingrations also capture events when an error is logged.',
-        {strong: <strong />}
-      ),
     },
     },
   ],
   ],
   configure: params => [
   configure: params => [

+ 26 - 1
static/app/gettingStartedDocs/dotnet/dotnet.spec.tsx

@@ -2,10 +2,12 @@ import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboa
 import {screen} from 'sentry-test/reactTestingLibrary';
 import {screen} from 'sentry-test/reactTestingLibrary';
 import {textWithMarkupMatcher} from 'sentry-test/utils';
 import {textWithMarkupMatcher} from 'sentry-test/utils';
 
 
+import {ProductSolution} from 'sentry/components/onboarding/productSelection';
+
 import docs from './dotnet';
 import docs from './dotnet';
 
 
 describe('dotnet onboarding docs', function () {
 describe('dotnet onboarding docs', function () {
-  it('renders docs correctly', async function () {
+  it('renders errors onboarding docs correctly', async function () {
     renderWithOnboardingLayout(docs, {
     renderWithOnboardingLayout(docs, {
       releaseRegistry: {
       releaseRegistry: {
         'sentry.dotnet': {
         'sentry.dotnet': {
@@ -30,4 +32,27 @@ describe('dotnet onboarding docs', function () {
       )
       )
     ).toBeInTheDocument();
     ).toBeInTheDocument();
   });
   });
+
+  it('renders performance onboarding docs correctly', async function () {
+    renderWithOnboardingLayout(docs, {
+      selectedProducts: [ProductSolution.PERFORMANCE_MONITORING],
+    });
+
+    expect(
+      await screen.findByText(textWithMarkupMatcher(/options.TracesSampleRate/))
+    ).toBeInTheDocument();
+  });
+
+  it('renders profiling onboarding docs correctly', async function () {
+    renderWithOnboardingLayout(docs, {
+      selectedProducts: [
+        ProductSolution.PERFORMANCE_MONITORING,
+        ProductSolution.PROFILING,
+      ],
+    });
+
+    expect(
+      await screen.findByText(textWithMarkupMatcher(/options.ProfilesSampleRate/))
+    ).toBeInTheDocument();
+  });
 });
 });

+ 147 - 34
static/app/gettingStartedDocs/dotnet/dotnet.tsx

@@ -1,5 +1,7 @@
 import {Fragment} from 'react';
 import {Fragment} from 'react';
+import styled from '@emotion/styled';
 
 
+import {Alert} from 'sentry/components/alert';
 import ExternalLink from 'sentry/components/links/externalLink';
 import ExternalLink from 'sentry/components/links/externalLink';
 import List from 'sentry/components/list';
 import List from 'sentry/components/list';
 import ListItem from 'sentry/components/list/listItem';
 import ListItem from 'sentry/components/list/listItem';
@@ -24,12 +26,39 @@ import {getPackageVersion} from 'sentry/utils/gettingStartedDocs/getPackageVersi
 type Params = DocsParams;
 type Params = DocsParams;
 
 
 const getInstallSnippetPackageManager = (params: Params) => `
 const getInstallSnippetPackageManager = (params: Params) => `
-Install-Package Sentry -Version ${getPackageVersion(params, 'sentry.dotnet', '3.34.0')}`;
+Install-Package Sentry -Version ${getPackageVersion(
+  params,
+  'sentry.dotnet',
+  params.isProfilingSelected ? '4.3.0' : '3.34.0'
+)}`;
 
 
 const getInstallSnippetCoreCli = (params: Params) => `
 const getInstallSnippetCoreCli = (params: Params) => `
-dotnet add package Sentry -v ${getPackageVersion(params, 'sentry.dotnet', '3.34.0')}`;
+dotnet add package Sentry -v ${getPackageVersion(
+  params,
+  'sentry.dotnet',
+  params.isProfilingSelected ? '4.3.0' : '3.34.0'
+)}`;
 
 
-const getConfigureSnippet = (params: Params) => `
+const getInstallProfilingSnippetPackageManager = (params: Params) => `
+Install-Package Sentry.Profiling -Version ${getPackageVersion(
+  params,
+  'sentry.dotnet.profiling',
+  '4.3.0'
+)}`;
+
+const getInstallProfilingSnippetCoreCli = (params: Params) => `
+dotnet add package Sentry.Profiling -v ${getPackageVersion(
+  params,
+  'sentry.dotnet.profiling',
+  '4.3.0'
+)}`;
+
+enum DotNetPlatform {
+  WINDOWS,
+  IOS_MACCATALYST,
+}
+
+const getConfigureSnippet = (params: Params, platform?: DotNetPlatform) => `
 using Sentry;
 using Sentry;
 
 
 SentrySdk.Init(options =>
 SentrySdk.Init(options =>
@@ -46,14 +75,38 @@ SentrySdk.Init(options =>
     options.Debug = true;
     options.Debug = true;
 
 
     // This option is recommended. It enables Sentry's "Release Health" feature.
     // This option is recommended. It enables Sentry's "Release Health" feature.
-    options.AutoSessionTracking = true;
+    options.AutoSessionTracking = true;${
+      params.isPerformanceSelected
+        ? `
 
 
-    // This option is recommended for client applications only. It ensures all threads use the same global scope.
-    // If you're writing a background service of any kind, you should remove this.
-    options.IsGlobalModeEnabled = true;
+    // Set TracesSampleRate to 1.0 to capture 100%
+    // of transactions for performance monitoring.
+    // We recommend adjusting this value in production.
+    options.TracesSampleRate = 1.0;`
+        : ''
+    }${
+      params.isProfilingSelected
+        ? `
 
 
-    // This option will enable Sentry's tracing features. You still need to start transactions and spans.
-    options.EnableTracing = true;
+    // Sample rate for profiling, applied on top of othe TracesSampleRate,
+    // e.g. 0.2 means we want to profile 20 % of the captured transactions.
+    // We recommend adjusting this value in production.
+    options.ProfilesSampleRate = 1.0;${
+      platform !== DotNetPlatform.IOS_MACCATALYST
+        ? `
+    // Requires NuGet package: Sentry.Profiling
+    // Note: By default, the profiler is initialized asynchronously. This can
+    // be tuned by passing a desired initialization timeout to the constructor.
+    options.AddIntegration(new ProfilingIntegration(
+        // During startup, wait up to 500ms to profile the app startup code.
+        // This could make launching the app a bit slower so comment it out if you
+        // prefer profiling to start asynchronously
+        TimeSpan.FromMilliseconds(500)
+    ));`
+        : ''
+    }`
+        : ''
+    }
 });`;
 });`;
 
 
 const getPerformanceMonitoringSnippet = () => `
 const getPerformanceMonitoringSnippet = () => `
@@ -106,6 +159,41 @@ const onboarding: OnboardingConfig = {
             },
             },
           ],
           ],
         },
         },
+        ...(params.isProfilingSelected
+          ? [
+              {
+                description: tct(
+                  'Additionally, for all platforms except iOS/Mac Catalyst, you need to add a dependency on the [sentryProfilingPackage:Sentry.Profiling] NuGet package.',
+                  {
+                    sentryProfilingPackage: <code />,
+                  }
+                ),
+                code: [
+                  {
+                    language: 'shell',
+                    label: 'Package Manager',
+                    value: 'packageManager',
+                    code: getInstallProfilingSnippetPackageManager(params),
+                  },
+                  {
+                    language: 'shell',
+                    label: '.NET Core CLI',
+                    value: 'coreCli',
+                    code: getInstallProfilingSnippetCoreCli(params),
+                  },
+                ],
+              },
+              {
+                description: (
+                  <AlertWithoutMarginBottom type="info">
+                    {t(
+                      'Profiling for .NET Framework and .NET on Android are not supported.'
+                    )}
+                  </AlertWithoutMarginBottom>
+                ),
+              },
+            ]
+          : []),
       ],
       ],
     },
     },
   ],
   ],
@@ -120,14 +208,31 @@ const onboarding: OnboardingConfig = {
         }
         }
       ),
       ),
       configurations: [
       configurations: [
-        {
-          language: 'csharp',
-          code: getConfigureSnippet(params),
-        },
+        params.isProfilingSelected
+          ? {
+              code: [
+                {
+                  language: 'csharp',
+                  label: 'Windows/Linux/macOS',
+                  value: 'windows/linux/macos',
+                  code: getConfigureSnippet(params, DotNetPlatform.WINDOWS),
+                },
+                {
+                  language: 'csharp',
+                  label: 'iOS/Mac Catalyst',
+                  value: 'ios/macCatalyst',
+                  code: getConfigureSnippet(params, DotNetPlatform.IOS_MACCATALYST),
+                },
+              ],
+            }
+          : {
+              language: 'csharp',
+              code: getConfigureSnippet(params),
+            },
       ],
       ],
     },
     },
   ],
   ],
-  verify: () => [
+  verify: (params: Params) => [
     {
     {
       type: StepType.VERIFY,
       type: StepType.VERIFY,
       description: t('Verify Sentry is correctly configured by sending a message:'),
       description: t('Verify Sentry is correctly configured by sending a message:'),
@@ -138,26 +243,30 @@ const onboarding: OnboardingConfig = {
         },
         },
       ],
       ],
     },
     },
-    {
-      title: t('Performance Monitoring'),
-      description: t(
-        'You can measure the performance of your code by capturing transactions and spans.'
-      ),
-      configurations: [
-        {
-          language: 'csharp',
-          code: getPerformanceMonitoringSnippet(),
-        },
-      ],
-      additionalInfo: tct(
-        'Check out [link:the documentation] to learn more about the API and automatic instrumentations.',
-        {
-          link: (
-            <ExternalLink href="https://docs.sentry.io/platforms/dotnet/performance/instrumentation/" />
-          ),
-        }
-      ),
-    },
+    ...(params.isPerformanceSelected
+      ? [
+          {
+            title: t('Performance Monitoring'),
+            description: t(
+              'You can measure the performance of your code by capturing transactions and spans.'
+            ),
+            configurations: [
+              {
+                language: 'csharp',
+                code: getPerformanceMonitoringSnippet(),
+              },
+            ],
+            additionalInfo: tct(
+              'Check out [link:the documentation] to learn more about the API and automatic instrumentations.',
+              {
+                link: (
+                  <ExternalLink href="https://docs.sentry.io/platforms/dotnet/performance/instrumentation/" />
+                ),
+              }
+            ),
+          },
+        ]
+      : []),
     {
     {
       title: t('Samples'),
       title: t('Samples'),
       description: (
       description: (
@@ -270,3 +379,7 @@ const docs: Docs = {
 };
 };
 
 
 export default docs;
 export default docs;
+
+const AlertWithoutMarginBottom = styled(Alert)`
+  margin-bottom: 0;
+`;

+ 6 - 2
static/app/gettingStartedDocs/dotnet/gcpfunctions.tsx

@@ -65,10 +65,14 @@ const getConfigureJsonSnippet = (params: Params) => `
     // When configuring for the first time, to see what the SDK is doing:
     // When configuring for the first time, to see what the SDK is doing:
     "Debug": true,
     "Debug": true,
     // Opt-in for payload submission.
     // Opt-in for payload submission.
-    "MaxRequestBodySize": "Always",
+    "MaxRequestBodySize": "Always"${
+      params.isPerformanceSelected
+        ? `,
     // Set TracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
     // Set TracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
     // We recommend adjusting this value in production.
     // We recommend adjusting this value in production.
-    "TracesSampleRate": 1
+    "TracesSampleRate": 1`
+        : ''
+    }
   }
   }
 }`;
 }`;
 
 

Some files were not shown because too many files changed in this diff