Skip to content

Commit a486344

Browse files
priscilawebdevJesse-Box
authored andcommitted
ref(onboarding): Split django onboarding docs (#103043)
Contributes to https://linear.app/getsentry/issue/TET-864/introduce-folders-for-onboarding-platforms
1 parent 37ad986 commit a486344

File tree

4 files changed

+120
-40
lines changed

4 files changed

+120
-40
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types';
2+
import {
3+
feedbackOnboardingJsLoader,
4+
replayOnboardingJsLoader,
5+
} from 'sentry/gettingStartedDocs/javascript/jsLoader/jsLoader';
6+
import {agentMonitoring} from 'sentry/gettingStartedDocs/python/python/agentMonitoring';
7+
import {crashReport} from 'sentry/gettingStartedDocs/python/python/crashReport';
8+
import {featureFlag} from 'sentry/gettingStartedDocs/python/python/featureFlag';
9+
import {logs} from 'sentry/gettingStartedDocs/python/python/logs';
10+
import {mcp} from 'sentry/gettingStartedDocs/python/python/mcp';
11+
import {profiling} from 'sentry/gettingStartedDocs/python/python/profiling';
12+
13+
import {onboarding} from './onboarding';
14+
import {performance} from './performance';
15+
16+
const docs: Docs = {
17+
onboarding,
18+
replayOnboardingJsLoader,
19+
profilingOnboarding: profiling({basePackage: 'sentry-sdk[django]'}),
20+
performanceOnboarding: performance,
21+
crashReportOnboarding: crashReport,
22+
featureFlagOnboarding: featureFlag,
23+
feedbackOnboardingJsLoader,
24+
agentMonitoringOnboarding: agentMonitoring,
25+
mcpOnboarding: mcp,
26+
logsOnboarding: logs({
27+
packageName: 'sentry-sdk[django]',
28+
}),
29+
};
30+
31+
export default docs;

static/app/gettingStartedDocs/python/django.spec.tsx renamed to static/app/gettingStartedDocs/python/django/onboarding.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {textWithMarkupMatcher} from 'sentry-test/utils';
66

77
import {ProductSolution} from 'sentry/components/onboarding/gettingStartedDoc/types';
88

9-
import docs from './django';
9+
import docs from '.';
1010

1111
describe('django onboarding docs', () => {
1212
it('renders doc correctly', () => {

static/app/gettingStartedDocs/python/django.tsx renamed to static/app/gettingStartedDocs/python/django/onboarding.tsx

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,15 @@
11
import {ExternalLink} from 'sentry/components/core/link';
22
import {
33
StepType,
4-
type Docs,
54
type DocsParams,
65
type OnboardingConfig,
76
} from 'sentry/components/onboarding/gettingStartedDoc/types';
8-
import {
9-
feedbackOnboardingJsLoader,
10-
replayOnboardingJsLoader,
11-
} from 'sentry/gettingStartedDocs/javascript/jsLoader/jsLoader';
12-
import {agentMonitoring} from 'sentry/gettingStartedDocs/python/python/agentMonitoring';
13-
import {crashReport} from 'sentry/gettingStartedDocs/python/python/crashReport';
14-
import {featureFlag} from 'sentry/gettingStartedDocs/python/python/featureFlag';
15-
import {logs, verify} from 'sentry/gettingStartedDocs/python/python/logs';
16-
import {mcp} from 'sentry/gettingStartedDocs/python/python/mcp';
17-
import {
18-
alternativeProfiling,
19-
profiling,
20-
} from 'sentry/gettingStartedDocs/python/python/profiling';
7+
import {verify} from 'sentry/gettingStartedDocs/python/python/logs';
8+
import {alternativeProfiling} from 'sentry/gettingStartedDocs/python/python/profiling';
219
import {getPythonInstallCodeBlock} from 'sentry/gettingStartedDocs/python/python/utils';
2210
import {t, tct} from 'sentry/locale';
2311

24-
type Params = DocsParams;
25-
26-
const getSdkSetupSnippet = (params: Params) => `
12+
const getSdkSetupSnippet = (params: DocsParams) => `
2713
import sentry_sdk
2814
2915
sentry_sdk.init(
@@ -65,7 +51,7 @@ sentry_sdk.init(
6551
)
6652
`;
6753

68-
const onboarding: OnboardingConfig = {
54+
export const onboarding: OnboardingConfig = {
6955
install: () => [
7056
{
7157
type: StepType.INSTALL,
@@ -80,7 +66,7 @@ const onboarding: OnboardingConfig = {
8066
],
8167
},
8268
],
83-
configure: (params: Params) => [
69+
configure: (params: DocsParams) => [
8470
{
8571
type: StepType.CONFIGURE,
8672
content: [
@@ -104,7 +90,7 @@ const onboarding: OnboardingConfig = {
10490
],
10591
},
10692
],
107-
verify: (params: Params) => [
93+
verify: (params: DocsParams) => [
10894
{
10995
type: StepType.VERIFY,
11096
content: [
@@ -152,7 +138,7 @@ urlpatterns = [
152138
],
153139
},
154140
],
155-
nextSteps: (params: Params) => {
141+
nextSteps: (params: DocsParams) => {
156142
const steps = [] as any[];
157143
if (params.isLogsSelected) {
158144
steps.push({
@@ -168,7 +154,7 @@ urlpatterns = [
168154
},
169155
};
170156

171-
const performanceOnboarding: OnboardingConfig = {
157+
export const performanceOnboarding: OnboardingConfig = {
172158
introduction: () =>
173159
t(
174160
"Adding Performance to your Django project is simple. Make sure you've got these basics down."
@@ -239,20 +225,3 @@ sentry_sdk.init(
239225
],
240226
nextSteps: () => [],
241227
};
242-
243-
const docs: Docs = {
244-
onboarding,
245-
replayOnboardingJsLoader,
246-
profilingOnboarding: profiling({basePackage: 'sentry-sdk[django]'}),
247-
performanceOnboarding,
248-
crashReportOnboarding: crashReport,
249-
featureFlagOnboarding: featureFlag,
250-
feedbackOnboardingJsLoader,
251-
agentMonitoringOnboarding: agentMonitoring,
252-
mcpOnboarding: mcp,
253-
logsOnboarding: logs({
254-
packageName: 'sentry-sdk[django]',
255-
}),
256-
};
257-
258-
export default docs;
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import {ExternalLink} from 'sentry/components/core/link';
2+
import {
3+
StepType,
4+
type OnboardingConfig,
5+
} from 'sentry/components/onboarding/gettingStartedDoc/types';
6+
import {t, tct} from 'sentry/locale';
7+
8+
import {onboarding} from './onboarding';
9+
10+
export const performance: OnboardingConfig = {
11+
introduction: () =>
12+
t(
13+
"Adding Performance to your Django project is simple. Make sure you've got these basics down."
14+
),
15+
install: onboarding.install,
16+
configure: params => [
17+
{
18+
type: StepType.CONFIGURE,
19+
content: [
20+
{
21+
type: 'text',
22+
text: tct(
23+
'To configure the Sentry SDK, initialize it in your [code:settings.py] file:',
24+
{code: <code />}
25+
),
26+
},
27+
{
28+
type: 'code',
29+
language: 'python',
30+
code: `
31+
import sentry_sdk
32+
33+
sentry_sdk.init(
34+
dsn="${params.dsn.public}",
35+
36+
# Set traces_sample_rate to 1.0 to capture 100%
37+
# of transactions for performance monitoring.
38+
traces_sample_rate=1.0,
39+
)`,
40+
},
41+
{
42+
type: 'text',
43+
text: tct(
44+
'Learn more about tracing [linkTracingOptions:options], how to use the [linkTracesSampler:traces_sampler] function, or how to do [linkSampleTransactions:sampling].',
45+
{
46+
linkTracingOptions: (
47+
<ExternalLink href="https://docs.sentry.io/platforms/python/configuration/options/#tracing-options" />
48+
),
49+
linkTracesSampler: (
50+
<ExternalLink href="https://docs.sentry.io/platforms/python/configuration/sampling/" />
51+
),
52+
linkSampleTransactions: (
53+
<ExternalLink href="https://docs.sentry.io/platforms/python/configuration/sampling/" />
54+
),
55+
}
56+
),
57+
},
58+
],
59+
},
60+
],
61+
verify: () => [
62+
{
63+
type: StepType.VERIFY,
64+
content: [
65+
{
66+
type: 'text',
67+
text: tct(
68+
'Verify that performance monitoring is working correctly with our [link:automatic instrumentation] by simply using your Python application.',
69+
{
70+
link: (
71+
<ExternalLink href="https://docs.sentry.io/platforms/python/tracing/instrumentation/automatic-instrumentation/" />
72+
),
73+
}
74+
),
75+
},
76+
],
77+
},
78+
],
79+
nextSteps: () => [],
80+
};

0 commit comments

Comments
 (0)