Skip to content

Commit 776eaca

Browse files
priscilawebdevandrewshie-sentry
authored andcommitted
ref(onboarding): Split flask onboarding docs (#103048)
Contributes to https://linear.app/getsentry/issue/TET-864/introduce-folders-for-onboarding-platforms
1 parent d07dd8d commit 776eaca

File tree

4 files changed

+118
-110
lines changed

4 files changed

+118
-110
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[flask]'}),
20+
performanceOnboarding: performance,
21+
crashReportOnboarding: crashReport,
22+
featureFlagOnboarding: featureFlag,
23+
feedbackOnboardingJsLoader,
24+
agentMonitoringOnboarding: agentMonitoring,
25+
mcpOnboarding: mcp,
26+
logsOnboarding: logs({
27+
packageName: 'sentry-sdk[flask]',
28+
}),
29+
};
30+
31+
export default docs;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboa
44
import {screen} from 'sentry-test/reactTestingLibrary';
55
import {textWithMarkupMatcher} from 'sentry-test/utils';
66

7-
import docs from './flask';
7+
import docs from '.';
88

99
describe('flask onboarding docs', () => {
1010
it('renders doc correctly', () => {
Lines changed: 7 additions & 109 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) => `import sentry_sdk
12+
const getSdkSetupSnippet = (params: DocsParams) => `import sentry_sdk
2713
from flask import Flask
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
introduction: () =>
7056
tct('The Flask integration adds support for the [link:Flask Framework].', {
7157
link: <ExternalLink href="https://flask.palletsprojects.com" />,
@@ -84,7 +70,7 @@ const onboarding: OnboardingConfig = {
8470
],
8571
},
8672
],
87-
configure: (params: Params) => [
73+
configure: (params: DocsParams) => [
8874
{
8975
type: StepType.CONFIGURE,
9076
content: [
@@ -115,7 +101,7 @@ app = Flask(__name__)
115101
],
116102
},
117103
],
118-
verify: (params: Params) => [
104+
verify: (params: DocsParams) => [
119105
{
120106
type: StepType.VERIFY,
121107
content: [
@@ -156,7 +142,7 @@ def hello_world():
156142
],
157143
},
158144
],
159-
nextSteps: (params: Params) => {
145+
nextSteps: (params: DocsParams) => {
160146
const steps = [] as any[];
161147
if (params.isLogsSelected) {
162148
steps.push({
@@ -171,91 +157,3 @@ def hello_world():
171157
return steps;
172158
},
173159
};
174-
175-
const performanceOnboarding: OnboardingConfig = {
176-
introduction: () =>
177-
t(
178-
"Adding Performance to your Flask project is simple. Make sure you've got these basics down."
179-
),
180-
install: onboarding.install,
181-
configure: params => [
182-
{
183-
type: StepType.CONFIGURE,
184-
content: [
185-
{
186-
type: 'text',
187-
text: tct(
188-
'To configure the Sentry SDK, initialize it in your [code:settings.py] file:',
189-
{code: <code />}
190-
),
191-
},
192-
{
193-
type: 'code',
194-
language: 'python',
195-
code: `
196-
import sentry-sdk
197-
198-
sentry_sdk.init(
199-
dsn: "${params.dsn.public}",
200-
# Set traces_sample_rate to 1.0 to capture 100%
201-
# of transactions for performance monitoring.
202-
traces_sample_rate=1.0,
203-
)`,
204-
},
205-
{
206-
type: 'text',
207-
text: tct(
208-
'Learn more about tracing [linkTracingOptions:options], how to use the [linkTracesSampler:traces_sampler] function, or how to [linkSampleTransactions:sample transactions].',
209-
{
210-
linkTracingOptions: (
211-
<ExternalLink href="https://docs.sentry.io/platforms/python/configuration/options/#tracing-options" />
212-
),
213-
linkTracesSampler: (
214-
<ExternalLink href="https://docs.sentry.io/platforms/python/configuration/sampling/" />
215-
),
216-
linkSampleTransactions: (
217-
<ExternalLink href="https://docs.sentry.io/platforms/python/configuration/sampling/" />
218-
),
219-
}
220-
),
221-
},
222-
],
223-
},
224-
],
225-
verify: () => [
226-
{
227-
type: StepType.VERIFY,
228-
content: [
229-
{
230-
type: 'text',
231-
text: tct(
232-
'Verify that performance monitoring is working correctly with our [link:automatic instrumentation] by simply using your Python application.',
233-
{
234-
link: (
235-
<ExternalLink href="https://docs.sentry.io/platforms/python/tracing/instrumentation/automatic-instrumentation/" />
236-
),
237-
}
238-
),
239-
},
240-
],
241-
},
242-
],
243-
nextSteps: () => [],
244-
};
245-
246-
const docs: Docs = {
247-
onboarding,
248-
replayOnboardingJsLoader,
249-
profilingOnboarding: profiling({basePackage: 'sentry-sdk[flask]'}),
250-
performanceOnboarding,
251-
crashReportOnboarding: crashReport,
252-
featureFlagOnboarding: featureFlag,
253-
feedbackOnboardingJsLoader,
254-
agentMonitoringOnboarding: agentMonitoring,
255-
mcpOnboarding: mcp,
256-
logsOnboarding: logs({
257-
packageName: 'sentry-sdk[flask]',
258-
}),
259-
};
260-
261-
export default docs;
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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 Flask 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+
# Set traces_sample_rate to 1.0 to capture 100%
36+
# of transactions for performance monitoring.
37+
traces_sample_rate=1.0,
38+
)`,
39+
},
40+
{
41+
type: 'text',
42+
text: tct(
43+
'Learn more about tracing [linkTracingOptions:options], how to use the [linkTracesSampler:traces_sampler] function, or how to [linkSampleTransactions:sample transactions].',
44+
{
45+
linkTracingOptions: (
46+
<ExternalLink href="https://docs.sentry.io/platforms/python/configuration/options/#tracing-options" />
47+
),
48+
linkTracesSampler: (
49+
<ExternalLink href="https://docs.sentry.io/platforms/python/configuration/sampling/" />
50+
),
51+
linkSampleTransactions: (
52+
<ExternalLink href="https://docs.sentry.io/platforms/python/configuration/sampling/" />
53+
),
54+
}
55+
),
56+
},
57+
],
58+
},
59+
],
60+
verify: () => [
61+
{
62+
type: StepType.VERIFY,
63+
content: [
64+
{
65+
type: 'text',
66+
text: tct(
67+
'Verify that performance monitoring is working correctly with our [link:automatic instrumentation] by simply using your Python application.',
68+
{
69+
link: (
70+
<ExternalLink href="https://docs.sentry.io/platforms/python/tracing/instrumentation/automatic-instrumentation/" />
71+
),
72+
}
73+
),
74+
},
75+
],
76+
},
77+
],
78+
nextSteps: () => [],
79+
};

0 commit comments

Comments
 (0)