Skip to content

Commit 8787b29

Browse files
.
1 parent 0f8c26c commit 8787b29

File tree

2 files changed

+8
-57
lines changed

2 files changed

+8
-57
lines changed

static/app/utils/gettingStartedDocs/python.spec.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,7 @@ describe('getPythonLogsOnboarding', () => {
107107
});
108108

109109
describe('getPythonMetricsOnboarding', () => {
110-
const mockParams = {
111-
dsn: {
112-
public: 'https://test@example.com/123',
113-
},
114-
};
115-
116-
it('generates logs onboarding config with default parameters', () => {
110+
it('generates metrics onboarding config with default parameters', () => {
117111
const result = getPythonMetricsOnboarding();
118112

119113
// Test install step
@@ -122,22 +116,14 @@ describe('getPythonMetricsOnboarding', () => {
122116
expect(installSteps[0].type).toBe('install');
123117
expect(installSteps[0].content).toHaveLength(2);
124118

125-
// Test configure step
126-
const configureSteps = result.configure(mockParams);
127-
expect(configureSteps).toHaveLength(1);
128-
expect(configureSteps[0].type).toBe('configure');
129-
expect(configureSteps[0].content[1].code).toContain('enable_logs=True');
130-
expect(configureSteps[0].content[1].code).toContain(mockParams.dsn.public);
131-
132119
// Test verify step
133120
const verifySteps = result.verify({isLogsSelected: true});
134121
expect(verifySteps).toHaveLength(1);
135122
expect(verifySteps[0].type).toBe('verify');
136123
expect(verifySteps[0].content).toHaveLength(1);
137124
expect(verifySteps[0].content[0].type).toBe('conditional');
138125
const conditionalContent = verifySteps[0].content[0].content;
139-
expect(conditionalContent[1].code).toContain('sentry_sdk.logger.info');
140-
expect(conditionalContent[3].code).toContain('import logging');
126+
expect(conditionalContent[1].code).toContain('metrics.count');
141127
});
142128

143129
it('generates logs onboarding config with custom parameters', () => {

static/app/utils/gettingStartedDocs/python.tsx

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ sentry_sdk.init(
149149
{
150150
type: StepType.VERIFY,
151151
description: t('Test that logs are working by sending some test logs:'),
152-
content: [getVerifyMetricsContent(params)],
152+
content: [getVerifyLogsContent(params)],
153153
},
154154
],
155155
});
@@ -166,7 +166,7 @@ export const getPythonMetricsOnboarding = ({
166166
{
167167
type: 'text',
168168
text: tct(
169-
'Install our Python SDK with a minimum version that supports logs ([code:2.44.0] or higher).',
169+
'Install our Python SDK with a minimum version that supports metrics ([code:2.44.0] or higher).',
170170
{
171171
code: <code />,
172172
}
@@ -179,47 +179,12 @@ export const getPythonMetricsOnboarding = ({
179179
],
180180
},
181181
],
182-
configure: (params: DocsParams) => [
183-
{
184-
type: StepType.CONFIGURE,
185-
content: [
186-
{
187-
type: 'text',
188-
text: tct(
189-
'Configure the Sentry SDK to capture logs by setting [code:enable_logs=True] in your [code:sentry_sdk.init()] call:',
190-
{
191-
code: <code />,
192-
}
193-
),
194-
},
195-
{
196-
type: 'code',
197-
language: 'python',
198-
code: `import sentry_sdk
199-
200-
sentry_sdk.init(
201-
dsn="${params.dsn.public}",
202-
# Enable logs to be sent to Sentry
203-
enable_logs=True,
204-
)`,
205-
},
206-
{
207-
type: 'text',
208-
text: tct(
209-
'For more detailed information on logging configuration, see the [link:logs documentation].',
210-
{
211-
link: <ExternalLink href="https://docs.sentry.io/platforms/python/logs/" />,
212-
}
213-
),
214-
},
215-
],
216-
},
217-
],
182+
configure: () => [],
218183
verify: (params: DocsParams) => [
219184
{
220185
type: StepType.VERIFY,
221-
description: t('Test that logs are working by sending some test logs:'),
222-
content: [getVerifyLogsContent(params)],
186+
description: t('Test that metrics are working by sending some test metrics:'),
187+
content: [getVerifyMetricsContent(params)],
223188
},
224189
],
225190
});
@@ -432,7 +397,7 @@ export const getVerifyMetricsContent = (params: DocsParams): ContentBlock => ({
432397
{
433398
type: 'code',
434399
language: 'python',
435-
code: `import sentry_sdk
400+
code: `from sentry_sdk import metrics
436401
437402
# Send metrics directly to Sentry
438403
metrics.count("checkout.failed", 1)

0 commit comments

Comments
 (0)