|
@@ -8,7 +8,10 @@ import {
|
|
|
} from 'sentry/components/onboarding/gettingStartedDoc/types';
|
|
|
import {getPythonMetricsOnboarding} from 'sentry/components/onboarding/gettingStartedDoc/utils/metricsOnboarding';
|
|
|
import replayOnboardingJsLoader from 'sentry/gettingStartedDocs/javascript/jsLoader/jsLoader';
|
|
|
-import {crashReportOnboardingPython} from 'sentry/gettingStartedDocs/python/python';
|
|
|
+import {
|
|
|
+ AlternativeConfiguration,
|
|
|
+ crashReportOnboardingPython,
|
|
|
+} from 'sentry/gettingStartedDocs/python/python';
|
|
|
import {t, tct} from 'sentry/locale';
|
|
|
|
|
|
type Params = DocsParams;
|
|
@@ -29,13 +32,23 @@ sentry_sdk.init(
|
|
|
traces_sample_rate=1.0,`
|
|
|
: ''
|
|
|
}${
|
|
|
- params.isProfilingSelected
|
|
|
+ params.isProfilingSelected &&
|
|
|
+ params.profilingOptions?.defaultProfilingMode === 'transaction'
|
|
|
? `
|
|
|
# Set profiles_sample_rate to 1.0 to profile 100%
|
|
|
# of sampled transactions.
|
|
|
# We recommend adjusting this value in production.
|
|
|
profiles_sample_rate=1.0,`
|
|
|
- : ''
|
|
|
+ : params.isProfilingSelected &&
|
|
|
+ params.profilingOptions?.defaultProfilingMode === 'continuous'
|
|
|
+ ? `
|
|
|
+ _experiments={
|
|
|
+ # Set continuous_profiling_auto_start to True
|
|
|
+ # to automatically start the profiler on when
|
|
|
+ # possible.
|
|
|
+ "continuous_profiling_auto_start": True,
|
|
|
+ },`
|
|
|
+ : ''
|
|
|
}
|
|
|
)
|
|
|
`;
|
|
@@ -102,9 +115,13 @@ app = web.Application()
|
|
|
app.add_routes([web.get('/', hello)])
|
|
|
|
|
|
web.run_app(app)
|
|
|
- `,
|
|
|
+`,
|
|
|
},
|
|
|
],
|
|
|
+ additionalInfo: params.isProfilingSelected &&
|
|
|
+ params.profilingOptions?.defaultProfilingMode === 'continuous' && (
|
|
|
+ <AlternativeConfiguration />
|
|
|
+ ),
|
|
|
},
|
|
|
],
|
|
|
verify: (params: Params) => [
|
|
@@ -118,15 +135,16 @@ web.run_app(app)
|
|
|
language: 'python',
|
|
|
|
|
|
code: `
|
|
|
- ${getSdkSetupSnippet(params)}
|
|
|
+${getSdkSetupSnippet(params)}
|
|
|
async def hello(request):
|
|
|
- 1/0 # raises an error
|
|
|
- return web.Response(text="Hello, world")
|
|
|
+ 1/0 # raises an error
|
|
|
+ return web.Response(text="Hello, world")
|
|
|
|
|
|
app = web.Application()
|
|
|
app.add_routes([web.get('/', hello)])
|
|
|
|
|
|
-web.run_app(app)`,
|
|
|
+web.run_app(app)
|
|
|
+`,
|
|
|
},
|
|
|
],
|
|
|
additionalInfo: (
|