Skip to content

Commit 4b55fea

Browse files
1 parent 2cdfbdd commit 4b55fea

File tree

3 files changed

+27
-29
lines changed

3 files changed

+27
-29
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types';
2+
import {agentMonitoring} from 'sentry/gettingStartedDocs/python/python/agentMonitoring';
3+
import {crashReport} from 'sentry/gettingStartedDocs/python/python/crashReport';
4+
import {logs} from 'sentry/gettingStartedDocs/python/python/logs';
5+
import {profiling} from 'sentry/gettingStartedDocs/python/python/profiling';
6+
7+
import {onboarding} from './onboarding';
8+
9+
const docs: Docs = {
10+
onboarding,
11+
profilingOnboarding: profiling({basePackage: 'sentry-sdk[rq]'}),
12+
crashReportOnboarding: crashReport,
13+
agentMonitoringOnboarding: agentMonitoring,
14+
logsOnboarding: logs({
15+
packageName: 'sentry-sdk[rq]',
16+
}),
17+
};
18+
19+
export default docs;

static/app/gettingStartedDocs/python/rq.spec.tsx renamed to static/app/gettingStartedDocs/python/rq/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 './rq';
7+
import docs from '.';
88

99
describe('rq onboarding docs', () => {
1010
it('renders doc correctly', () => {

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

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
import {ExternalLink} from 'sentry/components/core/link';
22
import type {
3-
Docs,
43
DocsParams,
54
OnboardingConfig,
65
} from 'sentry/components/onboarding/gettingStartedDoc/types';
76
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types';
8-
import {agentMonitoring} from 'sentry/gettingStartedDocs/python/python/agentMonitoring';
9-
import {crashReport} from 'sentry/gettingStartedDocs/python/python/crashReport';
10-
import {logs} from 'sentry/gettingStartedDocs/python/python/logs';
11-
import {
12-
alternativeProfiling,
13-
profiling,
14-
} from 'sentry/gettingStartedDocs/python/python/profiling';
7+
import {alternativeProfiling} from 'sentry/gettingStartedDocs/python/python/profiling';
158
import {getPythonInstallCodeBlock} from 'sentry/gettingStartedDocs/python/python/utils';
169
import {t, tct} from 'sentry/locale';
1710

18-
type Params = DocsParams;
19-
20-
const getInitCallSnippet = (params: Params) => `
11+
const getInitCallSnippet = (params: DocsParams) => `
2112
sentry_sdk.init(
2213
dsn="${params.dsn.public}",
2314
# Add data like request headers and IP for users,
@@ -57,7 +48,7 @@ sentry_sdk.init(
5748
)
5849
`;
5950

60-
const getSdkSetupSnippet = (params: Params) => `
51+
const getSdkSetupSnippet = (params: DocsParams) => `
6152
import sentry_sdk
6253
6354
${getInitCallSnippet(params)}`;
@@ -72,13 +63,13 @@ def hello(name):
7263
1/0 # raises an error
7364
return "Hello %s!" % name`;
7465

75-
const getWorkerSetupSnippet = (params: Params) => `
66+
const getWorkerSetupSnippet = (params: DocsParams) => `
7667
import sentry_sdk
7768
7869
# Sentry configuration for RQ worker processes
7970
${getInitCallSnippet(params)}`;
8071

81-
const getMainPythonScriptSetupSnippet = (params: Params) => `
72+
const getMainPythonScriptSetupSnippet = (params: DocsParams) => `
8273
from redis import Redis
8374
from rq import Queue
8475
@@ -94,7 +85,7 @@ q = Queue(connection=Redis())
9485
with sentry_sdk.start_transaction(name="testing_sentry"):
9586
result = q.enqueue(hello, "World")`;
9687

97-
const onboarding: OnboardingConfig = {
88+
export const onboarding: OnboardingConfig = {
9889
introduction: () =>
9990
tct('The RQ integration adds support for the [link:RQ Job Queue System].', {
10091
link: <ExternalLink href="https://python-rq.org/" />,
@@ -113,7 +104,7 @@ const onboarding: OnboardingConfig = {
113104
],
114105
},
115106
],
116-
configure: (params: Params) => [
107+
configure: (params: DocsParams) => [
117108
{
118109
type: StepType.CONFIGURE,
119110
content: [
@@ -242,15 +233,3 @@ const onboarding: OnboardingConfig = {
242233
},
243234
],
244235
};
245-
246-
const docs: Docs = {
247-
onboarding,
248-
profilingOnboarding: profiling({basePackage: 'sentry-sdk[rq]'}),
249-
crashReportOnboarding: crashReport,
250-
agentMonitoringOnboarding: agentMonitoring,
251-
logsOnboarding: logs({
252-
packageName: 'sentry-sdk[rq]',
253-
}),
254-
};
255-
256-
export default docs;

0 commit comments

Comments
 (0)