Skip to content

Commit f6f8179

Browse files
1 parent 4e2520d commit f6f8179

File tree

10 files changed

+1105
-163
lines changed

10 files changed

+1105
-163
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {getNodeAgentMonitoringOnboarding} from './utils';
2+
3+
export const agentMonitoring = getNodeAgentMonitoringOnboarding();
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import {
2+
StepType,
3+
type OnboardingConfig,
4+
} from 'sentry/components/onboarding/gettingStartedDoc/types';
5+
import {
6+
getCrashReportJavaScriptInstallSteps,
7+
getCrashReportModalConfigDescription,
8+
getCrashReportModalIntroduction,
9+
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
10+
11+
export const crashReport: OnboardingConfig = {
12+
introduction: () => getCrashReportModalIntroduction(),
13+
install: params => getCrashReportJavaScriptInstallSteps(params),
14+
configure: () => [
15+
{
16+
type: StepType.CONFIGURE,
17+
content: [
18+
{
19+
type: 'text',
20+
text: getCrashReportModalConfigDescription({
21+
link: 'https://docs.sentry.io/platforms/javascript/guides/node/user-feedback/configuration/#crash-report-modal',
22+
}),
23+
},
24+
],
25+
},
26+
],
27+
verify: () => [],
28+
nextSteps: () => [],
29+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types';
2+
import {
3+
feedbackOnboardingJsLoader,
4+
replayOnboardingJsLoader,
5+
} from 'sentry/gettingStartedDocs/javascript/jsLoader/jsLoader';
6+
7+
import {agentMonitoring} from './agentMonitoring';
8+
import {crashReport} from './crashReport';
9+
import {logs} from './logs';
10+
import {mcp} from './mcp';
11+
import {onboarding} from './onboarding';
12+
import {performance} from './performance';
13+
import {profiling} from './profiling';
14+
15+
const docs: Docs = {
16+
onboarding,
17+
replayOnboardingJsLoader,
18+
performanceOnboarding: performance,
19+
crashReportOnboarding: crashReport,
20+
feedbackOnboardingJsLoader,
21+
profilingOnboarding: profiling,
22+
logsOnboarding: logs,
23+
agentMonitoringOnboarding: agentMonitoring,
24+
mcpOnboarding: mcp,
25+
};
26+
27+
export default docs;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import {getNodeLogsOnboarding} from './utils';
2+
3+
export const logs = getNodeLogsOnboarding({
4+
docsPlatform: 'node',
5+
packageName: '@sentry/node',
6+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {getNodeMcpOnboarding} from './utils';
2+
3+
export const mcp = getNodeMcpOnboarding();

static/app/gettingStartedDocs/node/node.spec.tsx renamed to static/app/gettingStartedDocs/node/node/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 './node';
9+
import docs from '.';
1010

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

static/app/gettingStartedDocs/node/node.tsx renamed to static/app/gettingStartedDocs/node/node/onboarding.tsx

Lines changed: 7 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {ExternalLink} from 'sentry/components/core/link';
22
import type {
3-
Docs,
43
DocsParams,
54
OnboardingConfig,
65
} from 'sentry/components/onboarding/gettingStartedDoc/types';
@@ -9,27 +8,13 @@ import {
98
getAIRulesForCodeEditorStep,
109
getUploadSourceMapsStep,
1110
} from 'sentry/components/onboarding/gettingStartedDoc/utils';
12-
import {
13-
getCrashReportJavaScriptInstallSteps,
14-
getCrashReportModalConfigDescription,
15-
getCrashReportModalIntroduction,
16-
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
17-
import {
18-
feedbackOnboardingJsLoader,
19-
replayOnboardingJsLoader,
20-
} from 'sentry/gettingStartedDocs/javascript/jsLoader/jsLoader';
2111
import {t, tct} from 'sentry/locale';
12+
2213
import {
2314
getImportInstrumentSnippet,
2415
getInstallCodeBlock,
25-
getNodeAgentMonitoringOnboarding,
26-
getNodeLogsOnboarding,
27-
getNodeMcpOnboarding,
28-
getNodeProfilingOnboarding,
2916
getSdkInitSnippet,
30-
} from 'sentry/utils/gettingStartedDocs/node';
31-
32-
type Params = DocsParams;
17+
} from './utils';
3318

3419
const getSdkSetupSnippet = () => `
3520
${getImportInstrumentSnippet()}
@@ -44,12 +29,12 @@ const server = createServer((req, res) => {
4429
server.listen(3000, "127.0.0.1");
4530
`;
4631

47-
const onboarding: OnboardingConfig = {
32+
export const onboarding: OnboardingConfig = {
4833
introduction: () =>
4934
tct("In this quick guide you'll use [strong:npm] or [strong:yarn] to set up:", {
5035
strong: <strong />,
5136
}),
52-
install: (params: Params) => [
37+
install: params => [
5338
{
5439
type: StepType.INSTALL,
5540
content: [
@@ -61,7 +46,7 @@ const onboarding: OnboardingConfig = {
6146
],
6247
},
6348
],
64-
configure: (params: Params) => [
49+
configure: params => [
6550
{
6651
type: StepType.CONFIGURE,
6752
content: [
@@ -246,7 +231,7 @@ logger.fatal("Database connection pool exhausted", {
246231
`,
247232
}),
248233
],
249-
verify: (params: Params) => [
234+
verify: (params: DocsParams) => [
250235
{
251236
type: StepType.VERIFY,
252237
content: [
@@ -301,7 +286,7 @@ try {
301286
],
302287
},
303288
],
304-
nextSteps: (params: Params) => {
289+
nextSteps: (params: DocsParams) => {
305290
const steps = [];
306291

307292
if (params.isLogsSelected) {
@@ -318,143 +303,3 @@ try {
318303
return steps;
319304
},
320305
};
321-
322-
const crashReportOnboarding: OnboardingConfig = {
323-
introduction: () => getCrashReportModalIntroduction(),
324-
install: (params: Params) => getCrashReportJavaScriptInstallSteps(params),
325-
configure: () => [
326-
{
327-
type: StepType.CONFIGURE,
328-
content: [
329-
{
330-
type: 'text',
331-
text: getCrashReportModalConfigDescription({
332-
link: 'https://docs.sentry.io/platforms/javascript/guides/node/user-feedback/configuration/#crash-report-modal',
333-
}),
334-
},
335-
],
336-
},
337-
],
338-
verify: () => [],
339-
nextSteps: () => [],
340-
};
341-
342-
const performanceOnboarding: OnboardingConfig = {
343-
introduction: () =>
344-
t(
345-
"Adding Performance to your Node project is simple. Make sure you've got these basics down."
346-
),
347-
install: params => [
348-
{
349-
type: StepType.INSTALL,
350-
content: [
351-
{
352-
type: 'text',
353-
text: tct('Install our Node.js SDK using [code:npm] or [code:yarn]', {
354-
code: <code />,
355-
}),
356-
},
357-
getInstallCodeBlock(params),
358-
],
359-
},
360-
],
361-
configure: params => [
362-
{
363-
type: StepType.CONFIGURE,
364-
content: [
365-
{
366-
type: 'text',
367-
text: tct(
368-
'Sentry should be initialized as early in your app as possible. It is essential that you call [code:Sentry.init] before you require any other modules in your application—otherwise, auto-instrumentation of these modules will [strong:not] work.',
369-
{code: <code />, strong: <strong />}
370-
),
371-
},
372-
{
373-
type: 'text',
374-
text: tct(
375-
'To initialize the SDK before everything else, create an external file called [code:instrument.js/mjs] and make sure to import it in your apps entrypoint before anything else.',
376-
{code: <code />}
377-
),
378-
},
379-
{
380-
type: 'code',
381-
tabs: [
382-
{
383-
label: 'JavaScript',
384-
filename: 'instrument.(js|mjs)',
385-
language: 'javascript',
386-
code: getSdkInitSnippet(params, 'node'),
387-
},
388-
],
389-
},
390-
{
391-
type: 'text',
392-
text: tct(
393-
'We recommend adjusting the value of [code:tracesSampleRate] in production. Learn more about tracing [linkTracingOptions:options], how to use the [linkTracesSampler:traces_sampler] function, or how to [linkSampleTransactions:sample transactions].',
394-
{
395-
code: <code />,
396-
linkTracingOptions: (
397-
<ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/node/configuration/options/#tracing-options" />
398-
),
399-
linkTracesSampler: (
400-
<ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/node/configuration/sampling/" />
401-
),
402-
linkSampleTransactions: (
403-
<ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/node/configuration/sampling/" />
404-
),
405-
}
406-
),
407-
},
408-
],
409-
},
410-
],
411-
verify: () => [
412-
{
413-
type: StepType.VERIFY,
414-
content: [
415-
{
416-
type: 'text',
417-
text: tct(
418-
'Verify that performance monitoring is working correctly with our [link:automatic instrumentation] by simply using your Node application.',
419-
{
420-
link: (
421-
<ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/node/tracing/instrumentation/automatic-instrumentation/" />
422-
),
423-
}
424-
),
425-
},
426-
{
427-
type: 'text',
428-
text: tct(
429-
'You have the option to manually construct a transaction using [link:custom instrumentation].',
430-
{
431-
link: (
432-
<ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/node/tracing/instrumentation/custom-instrumentation/" />
433-
),
434-
}
435-
),
436-
},
437-
],
438-
},
439-
],
440-
nextSteps: () => [],
441-
};
442-
443-
const docs: Docs = {
444-
onboarding,
445-
replayOnboardingJsLoader,
446-
performanceOnboarding,
447-
crashReportOnboarding,
448-
feedbackOnboardingJsLoader,
449-
profilingOnboarding: getNodeProfilingOnboarding({
450-
profilingLifecycle: 'manual',
451-
}),
452-
logsOnboarding: getNodeLogsOnboarding({
453-
docsPlatform: 'node',
454-
packageName: '@sentry/node',
455-
}),
456-
agentMonitoringOnboarding: getNodeAgentMonitoringOnboarding(),
457-
mcpOnboarding: getNodeMcpOnboarding(),
458-
};
459-
460-
export default docs;

0 commit comments

Comments
 (0)