From 71248ab83cf23108a627eac62ea1ac3deb5efbe9 Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Mon, 10 Nov 2025 13:27:53 +0100 Subject: [PATCH 1/4] ref(onboarding): Split django onboarding docs --- .../python/django/index.tsx | 30 ++++++++++++ .../onboarding.spec.tsx} | 2 +- .../{django.tsx => django/onboarding.tsx} | 47 ++++--------------- 3 files changed, 39 insertions(+), 40 deletions(-) create mode 100644 static/app/gettingStartedDocs/python/django/index.tsx rename static/app/gettingStartedDocs/python/{django.spec.tsx => django/onboarding.spec.tsx} (99%) rename static/app/gettingStartedDocs/python/{django.tsx => django/onboarding.tsx} (82%) diff --git a/static/app/gettingStartedDocs/python/django/index.tsx b/static/app/gettingStartedDocs/python/django/index.tsx new file mode 100644 index 00000000000000..57ac7ec72a2389 --- /dev/null +++ b/static/app/gettingStartedDocs/python/django/index.tsx @@ -0,0 +1,30 @@ +import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types'; +import { + feedbackOnboardingJsLoader, + replayOnboardingJsLoader, +} from 'sentry/gettingStartedDocs/javascript/jsLoader/jsLoader'; +import {agentMonitoring} from 'sentry/gettingStartedDocs/python/python/agentMonitoring'; +import {crashReport} from 'sentry/gettingStartedDocs/python/python/crashReport'; +import {featureFlag} from 'sentry/gettingStartedDocs/python/python/featureFlag'; +import {logs} from 'sentry/gettingStartedDocs/python/python/logs'; +import {mcp} from 'sentry/gettingStartedDocs/python/python/mcp'; +import {profiling} from 'sentry/gettingStartedDocs/python/python/profiling'; + +import {onboarding, performanceOnboarding} from './onboarding'; + +const docs: Docs = { + onboarding, + replayOnboardingJsLoader, + profilingOnboarding: profiling({basePackage: 'sentry-sdk[django]'}), + performanceOnboarding, + crashReportOnboarding: crashReport, + featureFlagOnboarding: featureFlag, + feedbackOnboardingJsLoader, + agentMonitoringOnboarding: agentMonitoring, + mcpOnboarding: mcp, + logsOnboarding: logs({ + packageName: 'sentry-sdk[django]', + }), +}; + +export default docs; diff --git a/static/app/gettingStartedDocs/python/django.spec.tsx b/static/app/gettingStartedDocs/python/django/onboarding.spec.tsx similarity index 99% rename from static/app/gettingStartedDocs/python/django.spec.tsx rename to static/app/gettingStartedDocs/python/django/onboarding.spec.tsx index 4acb3dc6491af8..15ba81570b59ff 100644 --- a/static/app/gettingStartedDocs/python/django.spec.tsx +++ b/static/app/gettingStartedDocs/python/django/onboarding.spec.tsx @@ -6,7 +6,7 @@ import {textWithMarkupMatcher} from 'sentry-test/utils'; import {ProductSolution} from 'sentry/components/onboarding/gettingStartedDoc/types'; -import docs from './django'; +import docs from '.'; describe('django onboarding docs', () => { it('renders doc correctly', () => { diff --git a/static/app/gettingStartedDocs/python/django.tsx b/static/app/gettingStartedDocs/python/django/onboarding.tsx similarity index 82% rename from static/app/gettingStartedDocs/python/django.tsx rename to static/app/gettingStartedDocs/python/django/onboarding.tsx index 5426f1ee7a2839..320611f8d3264c 100644 --- a/static/app/gettingStartedDocs/python/django.tsx +++ b/static/app/gettingStartedDocs/python/django/onboarding.tsx @@ -1,29 +1,15 @@ import {ExternalLink} from 'sentry/components/core/link'; import { StepType, - type Docs, type DocsParams, type OnboardingConfig, } from 'sentry/components/onboarding/gettingStartedDoc/types'; -import { - feedbackOnboardingJsLoader, - replayOnboardingJsLoader, -} from 'sentry/gettingStartedDocs/javascript/jsLoader/jsLoader'; -import {agentMonitoring} from 'sentry/gettingStartedDocs/python/python/agentMonitoring'; -import {crashReport} from 'sentry/gettingStartedDocs/python/python/crashReport'; -import {featureFlag} from 'sentry/gettingStartedDocs/python/python/featureFlag'; -import {logs, verify} from 'sentry/gettingStartedDocs/python/python/logs'; -import {mcp} from 'sentry/gettingStartedDocs/python/python/mcp'; -import { - alternativeProfiling, - profiling, -} from 'sentry/gettingStartedDocs/python/python/profiling'; +import {verify} from 'sentry/gettingStartedDocs/python/python/logs'; +import {alternativeProfiling} from 'sentry/gettingStartedDocs/python/python/profiling'; import {getPythonInstallCodeBlock} from 'sentry/gettingStartedDocs/python/python/utils'; import {t, tct} from 'sentry/locale'; -type Params = DocsParams; - -const getSdkSetupSnippet = (params: Params) => ` +const getSdkSetupSnippet = (params: DocsParams) => ` import sentry_sdk sentry_sdk.init( @@ -65,7 +51,7 @@ sentry_sdk.init( ) `; -const onboarding: OnboardingConfig = { +export const onboarding: OnboardingConfig = { install: () => [ { type: StepType.INSTALL, @@ -80,7 +66,7 @@ const onboarding: OnboardingConfig = { ], }, ], - configure: (params: Params) => [ + configure: (params: DocsParams) => [ { type: StepType.CONFIGURE, content: [ @@ -104,7 +90,7 @@ const onboarding: OnboardingConfig = { ], }, ], - verify: (params: Params) => [ + verify: (params: DocsParams) => [ { type: StepType.VERIFY, content: [ @@ -152,7 +138,7 @@ urlpatterns = [ ], }, ], - nextSteps: (params: Params) => { + nextSteps: (params: DocsParams) => { const steps = [] as any[]; if (params.isLogsSelected) { steps.push({ @@ -168,7 +154,7 @@ urlpatterns = [ }, }; -const performanceOnboarding: OnboardingConfig = { +export const performanceOnboarding: OnboardingConfig = { introduction: () => t( "Adding Performance to your Django project is simple. Make sure you've got these basics down." @@ -239,20 +225,3 @@ sentry_sdk.init( ], nextSteps: () => [], }; - -const docs: Docs = { - onboarding, - replayOnboardingJsLoader, - profilingOnboarding: profiling({basePackage: 'sentry-sdk[django]'}), - performanceOnboarding, - crashReportOnboarding: crashReport, - featureFlagOnboarding: featureFlag, - feedbackOnboardingJsLoader, - agentMonitoringOnboarding: agentMonitoring, - mcpOnboarding: mcp, - logsOnboarding: logs({ - packageName: 'sentry-sdk[django]', - }), -}; - -export default docs; From 4a2cb39832d7e5a3b210a3a279ed1b22b6317f4a Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Mon, 10 Nov 2025 13:42:49 +0100 Subject: [PATCH 2/4] split performance --- .../python/django/index.tsx | 5 +- .../python/django/performance.tsx | 80 +++++++++++++++++++ 2 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 static/app/gettingStartedDocs/python/django/performance.tsx diff --git a/static/app/gettingStartedDocs/python/django/index.tsx b/static/app/gettingStartedDocs/python/django/index.tsx index 57ac7ec72a2389..d67153fbcd9d7a 100644 --- a/static/app/gettingStartedDocs/python/django/index.tsx +++ b/static/app/gettingStartedDocs/python/django/index.tsx @@ -10,13 +10,14 @@ import {logs} from 'sentry/gettingStartedDocs/python/python/logs'; import {mcp} from 'sentry/gettingStartedDocs/python/python/mcp'; import {profiling} from 'sentry/gettingStartedDocs/python/python/profiling'; -import {onboarding, performanceOnboarding} from './onboarding'; +import {onboarding} from './onboarding'; +import {performance} from './performance'; const docs: Docs = { onboarding, replayOnboardingJsLoader, profilingOnboarding: profiling({basePackage: 'sentry-sdk[django]'}), - performanceOnboarding, + performanceOnboarding: performance, crashReportOnboarding: crashReport, featureFlagOnboarding: featureFlag, feedbackOnboardingJsLoader, diff --git a/static/app/gettingStartedDocs/python/django/performance.tsx b/static/app/gettingStartedDocs/python/django/performance.tsx new file mode 100644 index 00000000000000..190fca830c9ab1 --- /dev/null +++ b/static/app/gettingStartedDocs/python/django/performance.tsx @@ -0,0 +1,80 @@ +import {ExternalLink} from 'sentry/components/core/link'; +import { + StepType, + type OnboardingConfig, +} from 'sentry/components/onboarding/gettingStartedDoc/types'; +import {t, tct} from 'sentry/locale'; + +import {onboarding} from './onboarding'; + +export const performance: OnboardingConfig = { + introduction: () => + t( + "Adding Performance to your Django project is simple. Make sure you've got these basics down." + ), + install: onboarding.install, + configure: params => [ + { + type: StepType.CONFIGURE, + content: [ + { + type: 'text', + text: tct( + 'To configure the Sentry SDK, initialize it in your [code:settings.py] file:', + {code: } + ), + }, + { + type: 'code', + language: 'python', + code: ` +import sentry_sdk + +sentry_sdk.init( + dsn: "${params.dsn.public}", + + // Set traces_sample_rate to 1.0 to capture 100% + // of transactions for performance monitoring. + traces_sample_rate=1.0, +)`, + }, + { + type: 'text', + text: tct( + 'Learn more about tracing [linkTracingOptions:options], how to use the [linkTracesSampler:traces_sampler] function, or how to do [linkSampleTransactions:sampling].', + { + linkTracingOptions: ( + + ), + linkTracesSampler: ( + + ), + linkSampleTransactions: ( + + ), + } + ), + }, + ], + }, + ], + verify: () => [ + { + type: StepType.VERIFY, + content: [ + { + type: 'text', + text: tct( + 'Verify that performance monitoring is working correctly with our [link:automatic instrumentation] by simply using your Python application.', + { + link: ( + + ), + } + ), + }, + ], + }, + ], + nextSteps: () => [], +}; From 64273ea7526255581b3df6c57097e32453be821e Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Mon, 10 Nov 2025 15:03:06 +0100 Subject: [PATCH 3/4] suggestions --- static/app/gettingStartedDocs/python/django/performance.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/app/gettingStartedDocs/python/django/performance.tsx b/static/app/gettingStartedDocs/python/django/performance.tsx index 190fca830c9ab1..7cf1ca4662c18d 100644 --- a/static/app/gettingStartedDocs/python/django/performance.tsx +++ b/static/app/gettingStartedDocs/python/django/performance.tsx @@ -31,10 +31,10 @@ export const performance: OnboardingConfig = { import sentry_sdk sentry_sdk.init( - dsn: "${params.dsn.public}", + dsn="${params.dsn.public}", - // Set traces_sample_rate to 1.0 to capture 100% - // of transactions for performance monitoring. + # Set traces_sample_rate to 1.0 to capture 100% + # of transactions for performance monitoring. traces_sample_rate=1.0, )`, }, From 06548c06a1bb93daaf6fc310621c705fe304f643 Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Mon, 10 Nov 2025 15:57:30 +0100 Subject: [PATCH 4/4] indentation feedback --- .../app/gettingStartedDocs/python/django/performance.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/app/gettingStartedDocs/python/django/performance.tsx b/static/app/gettingStartedDocs/python/django/performance.tsx index 7cf1ca4662c18d..13257ce689b4e9 100644 --- a/static/app/gettingStartedDocs/python/django/performance.tsx +++ b/static/app/gettingStartedDocs/python/django/performance.tsx @@ -31,11 +31,11 @@ export const performance: OnboardingConfig = { import sentry_sdk sentry_sdk.init( - dsn="${params.dsn.public}", + dsn="${params.dsn.public}", - # Set traces_sample_rate to 1.0 to capture 100% - # of transactions for performance monitoring. - traces_sample_rate=1.0, + # Set traces_sample_rate to 1.0 to capture 100% + # of transactions for performance monitoring. + traces_sample_rate=1.0, )`, }, {