diff --git a/static/app/gettingStartedDocs/python/aiohttp.spec.tsx b/static/app/gettingStartedDocs/python/aiohttp.spec.tsx index 9c4c7e096291fa..8eab689bc0086f 100644 --- a/static/app/gettingStartedDocs/python/aiohttp.spec.tsx +++ b/static/app/gettingStartedDocs/python/aiohttp.spec.tsx @@ -42,17 +42,16 @@ describe('aiohttp onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config - const matches = screen.getAllByText( - textWithMarkupMatcher(/profiles_sample_rate=1\.0,/) - ); - expect(matches.length).toBeGreaterThan(0); - matches.forEach(match => expect(match).toBeInTheDocument()); + expect( + screen.getByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + ).toBeInTheDocument(); }); it('renders continuous profiling', function () { @@ -70,14 +69,15 @@ describe('aiohttp onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate: 1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate: 1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config - const matches = screen.getAllByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ); - expect(matches.length).toBeGreaterThan(0); - matches.forEach(match => expect(match).toBeInTheDocument()); + expect( + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).toBeInTheDocument(); + expect( + screen.getByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) + ).toBeInTheDocument(); }); }); diff --git a/static/app/gettingStartedDocs/python/aiohttp.tsx b/static/app/gettingStartedDocs/python/aiohttp.tsx index 79364d5a1c5d90..d254d139f82010 100644 --- a/static/app/gettingStartedDocs/python/aiohttp.tsx +++ b/static/app/gettingStartedDocs/python/aiohttp.tsx @@ -48,12 +48,12 @@ sentry_sdk.init( : params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode === 'continuous' ? ` - _experiments={ - # Set continuous_profiling_auto_start to True - # to automatically start the profiler when - # possible. - "continuous_profiling_auto_start": True, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/asgi.spec.tsx b/static/app/gettingStartedDocs/python/asgi.spec.tsx index a400cc54150f63..d152fc46d460c3 100644 --- a/static/app/gettingStartedDocs/python/asgi.spec.tsx +++ b/static/app/gettingStartedDocs/python/asgi.spec.tsx @@ -28,7 +28,7 @@ describe('asgi onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -42,14 +42,15 @@ describe('asgi onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config expect( - screen.getByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).toBeInTheDocument(); }); @@ -68,12 +69,15 @@ describe('asgi onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config expect( - screen.getByText(textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).toBeInTheDocument(); + expect( + screen.getByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).toBeInTheDocument(); }); }); diff --git a/static/app/gettingStartedDocs/python/asgi.tsx b/static/app/gettingStartedDocs/python/asgi.tsx index d69a5903d9d656..e44b00d874c978 100644 --- a/static/app/gettingStartedDocs/python/asgi.tsx +++ b/static/app/gettingStartedDocs/python/asgi.tsx @@ -39,19 +39,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/awslambda.spec.tsx b/static/app/gettingStartedDocs/python/awslambda.spec.tsx index f1469a835fe0fa..feab788051042d 100644 --- a/static/app/gettingStartedDocs/python/awslambda.spec.tsx +++ b/static/app/gettingStartedDocs/python/awslambda.spec.tsx @@ -28,7 +28,7 @@ describe('awslambda onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -42,14 +42,15 @@ describe('awslambda onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config expect( - screen.getByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).toBeInTheDocument(); }); @@ -68,12 +69,15 @@ describe('awslambda onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config expect( - screen.getByText(textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).toBeInTheDocument(); + expect( + screen.getByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).toBeInTheDocument(); }); }); diff --git a/static/app/gettingStartedDocs/python/awslambda.tsx b/static/app/gettingStartedDocs/python/awslambda.tsx index 73068600260818..112841b34628db 100644 --- a/static/app/gettingStartedDocs/python/awslambda.tsx +++ b/static/app/gettingStartedDocs/python/awslambda.tsx @@ -47,19 +47,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/bottle.spec.tsx b/static/app/gettingStartedDocs/python/bottle.spec.tsx index d26f5c9f331720..4c418b976e9bc6 100644 --- a/static/app/gettingStartedDocs/python/bottle.spec.tsx +++ b/static/app/gettingStartedDocs/python/bottle.spec.tsx @@ -30,7 +30,7 @@ describe('bottle onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -44,14 +44,15 @@ describe('bottle onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config const matches = screen.getAllByText( - textWithMarkupMatcher(/profiles_sample_rate=1\.0,/) + textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/) ); expect(matches.length).toBeGreaterThan(0); matches.forEach(match => expect(match).toBeInTheDocument()); @@ -72,14 +73,19 @@ describe('bottle onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate: 1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate: 1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config - const matches = screen.getAllByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) + const sampleRateMatches = screen.getAllByText( + textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/) ); - expect(matches.length).toBeGreaterThan(0); - matches.forEach(match => expect(match).toBeInTheDocument()); + expect(sampleRateMatches.length).toBeGreaterThan(0); + sampleRateMatches.forEach(match => expect(match).toBeInTheDocument()); + const lifeCycleMatches = screen.getAllByText( + textWithMarkupMatcher(/profile_lifecycle="trace",/) + ); + expect(lifeCycleMatches.length).toBeGreaterThan(0); + lifeCycleMatches.forEach(match => expect(match).toBeInTheDocument()); }); }); diff --git a/static/app/gettingStartedDocs/python/bottle.tsx b/static/app/gettingStartedDocs/python/bottle.tsx index 1490fb4942d439..1ea377e4fbd1bb 100644 --- a/static/app/gettingStartedDocs/python/bottle.tsx +++ b/static/app/gettingStartedDocs/python/bottle.tsx @@ -39,19 +39,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/celery.spec.tsx b/static/app/gettingStartedDocs/python/celery.spec.tsx index 5299482fc68893..6f0469a8418907 100644 --- a/static/app/gettingStartedDocs/python/celery.spec.tsx +++ b/static/app/gettingStartedDocs/python/celery.spec.tsx @@ -32,7 +32,7 @@ describe('celery onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -46,15 +46,15 @@ describe('celery onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText(textWithMarkupMatcher(/sentry_sdk.profiler.start_profiler\(\)/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); expect( - screen.queryByText(textWithMarkupMatcher(/sentry_sdk.profiler.stop_profiler\(\)/)) + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config expect( - screen.getByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).toBeInTheDocument(); }); @@ -73,15 +73,15 @@ describe('celery onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config expect( - screen.getByText(textWithMarkupMatcher(/sentry_sdk.profiler.start_profiler\(\)/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).toBeInTheDocument(); expect( - screen.getByText(textWithMarkupMatcher(/sentry_sdk.profiler.stop_profiler\(\)/)) + screen.getByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).toBeInTheDocument(); }); }); diff --git a/static/app/gettingStartedDocs/python/celery.tsx b/static/app/gettingStartedDocs/python/celery.tsx index 9961a74fed7825..73cde35dfe31cd 100644 --- a/static/app/gettingStartedDocs/python/celery.tsx +++ b/static/app/gettingStartedDocs/python/celery.tsx @@ -40,27 +40,23 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_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' + ? ` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` + : '' } -)${ - params.isProfilingSelected && - params.profilingOptions?.defaultProfilingMode === 'continuous' - ? ` - -# Manually call start_profiler and stop_profiler -# to profile the code in between -sentry_sdk.profiler.start_profiler() -# this code will be profiled -# -# Calls to stop_profiler are optional - if you don't stop the profiler, it will keep profiling -# your application until the process exits or stop_profiler is called. -sentry_sdk.profiler.stop_profiler()` - : '' -}`; +) +`; const onboarding: OnboardingConfig = { introduction: () => diff --git a/static/app/gettingStartedDocs/python/chalice.spec.tsx b/static/app/gettingStartedDocs/python/chalice.spec.tsx index 0d76a5b7eebf0f..d6e42474d97b6c 100644 --- a/static/app/gettingStartedDocs/python/chalice.spec.tsx +++ b/static/app/gettingStartedDocs/python/chalice.spec.tsx @@ -30,7 +30,7 @@ describe('chalice onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -44,14 +44,15 @@ describe('chalice onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config expect( - screen.getByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).toBeInTheDocument(); }); @@ -70,12 +71,15 @@ describe('chalice onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config expect( - screen.getByText(textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).toBeInTheDocument(); + expect( + screen.getByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).toBeInTheDocument(); }); }); diff --git a/static/app/gettingStartedDocs/python/chalice.tsx b/static/app/gettingStartedDocs/python/chalice.tsx index fc0afa13d557c6..268bf221e705a5 100644 --- a/static/app/gettingStartedDocs/python/chalice.tsx +++ b/static/app/gettingStartedDocs/python/chalice.tsx @@ -37,19 +37,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/django.spec.tsx b/static/app/gettingStartedDocs/python/django.spec.tsx index f752e23a64bf8c..f7ced15d4b350b 100644 --- a/static/app/gettingStartedDocs/python/django.spec.tsx +++ b/static/app/gettingStartedDocs/python/django.spec.tsx @@ -30,7 +30,7 @@ describe('django onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -44,14 +44,15 @@ describe('django onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config expect( - screen.getByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).toBeInTheDocument(); }); @@ -70,12 +71,15 @@ describe('django onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config expect( - screen.getByText(textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).toBeInTheDocument(); + expect( + screen.getByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).toBeInTheDocument(); }); }); diff --git a/static/app/gettingStartedDocs/python/django.tsx b/static/app/gettingStartedDocs/python/django.tsx index 1ac5501ebea481..350ccbf86df40b 100644 --- a/static/app/gettingStartedDocs/python/django.tsx +++ b/static/app/gettingStartedDocs/python/django.tsx @@ -39,19 +39,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/falcon.spec.tsx b/static/app/gettingStartedDocs/python/falcon.spec.tsx index 8ebe99546bde4d..4c53205365b7a7 100644 --- a/static/app/gettingStartedDocs/python/falcon.spec.tsx +++ b/static/app/gettingStartedDocs/python/falcon.spec.tsx @@ -30,7 +30,7 @@ describe('falcon onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -44,14 +44,15 @@ describe('falcon onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config const matches = screen.getAllByText( - textWithMarkupMatcher(/profiles_sample_rate=1\.0,/) + textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/) ); expect(matches.length).toBeGreaterThan(0); matches.forEach(match => expect(match).toBeInTheDocument()); @@ -72,14 +73,19 @@ describe('falcon onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate: 1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate: 1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config - const matches = screen.getAllByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) + const sampleRateMatches = screen.getAllByText( + textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/) ); - expect(matches.length).toBeGreaterThan(0); - matches.forEach(match => expect(match).toBeInTheDocument()); + expect(sampleRateMatches.length).toBeGreaterThan(0); + sampleRateMatches.forEach(match => expect(match).toBeInTheDocument()); + const lifeCycleMatches = screen.getAllByText( + textWithMarkupMatcher(/profile_lifecycle="trace",/) + ); + expect(lifeCycleMatches.length).toBeGreaterThan(0); + lifeCycleMatches.forEach(match => expect(match).toBeInTheDocument()); }); }); diff --git a/static/app/gettingStartedDocs/python/falcon.tsx b/static/app/gettingStartedDocs/python/falcon.tsx index 3412ad637a557f..473adcd87e53b7 100644 --- a/static/app/gettingStartedDocs/python/falcon.tsx +++ b/static/app/gettingStartedDocs/python/falcon.tsx @@ -40,19 +40,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/fastapi.spec.tsx b/static/app/gettingStartedDocs/python/fastapi.spec.tsx index fc31c125e87495..79afa290a20ba5 100644 --- a/static/app/gettingStartedDocs/python/fastapi.spec.tsx +++ b/static/app/gettingStartedDocs/python/fastapi.spec.tsx @@ -30,7 +30,7 @@ describe('flask onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -44,14 +44,15 @@ describe('flask onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config expect( - screen.getByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).toBeInTheDocument(); }); @@ -70,12 +71,15 @@ describe('flask onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate: 1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate: 1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config expect( - screen.getByText(textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).toBeInTheDocument(); + expect( + screen.getByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).toBeInTheDocument(); }); }); diff --git a/static/app/gettingStartedDocs/python/fastapi.tsx b/static/app/gettingStartedDocs/python/fastapi.tsx index daf2eec5637b3a..04238a4750fe69 100644 --- a/static/app/gettingStartedDocs/python/fastapi.tsx +++ b/static/app/gettingStartedDocs/python/fastapi.tsx @@ -42,19 +42,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/flask.spec.tsx b/static/app/gettingStartedDocs/python/flask.spec.tsx index a3dd1599174239..5eab4aad472e11 100644 --- a/static/app/gettingStartedDocs/python/flask.spec.tsx +++ b/static/app/gettingStartedDocs/python/flask.spec.tsx @@ -30,7 +30,7 @@ describe('flask onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -44,14 +44,15 @@ describe('flask onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config const matches = screen.getAllByText( - textWithMarkupMatcher(/profiles_sample_rate=1\.0,/) + textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/) ); expect(matches.length).toBeGreaterThan(0); matches.forEach(match => expect(match).toBeInTheDocument()); @@ -72,14 +73,19 @@ describe('flask onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate: 1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate: 1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config - const matches = screen.getAllByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) + const sampleRateMatches = screen.getAllByText( + textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/) ); - expect(matches.length).toBeGreaterThan(0); - matches.forEach(match => expect(match).toBeInTheDocument()); + expect(sampleRateMatches.length).toBeGreaterThan(0); + sampleRateMatches.forEach(match => expect(match).toBeInTheDocument()); + const lifeCycleMatches = screen.getAllByText( + textWithMarkupMatcher(/profile_lifecycle="trace",/) + ); + expect(lifeCycleMatches.length).toBeGreaterThan(0); + lifeCycleMatches.forEach(match => expect(match).toBeInTheDocument()); }); }); diff --git a/static/app/gettingStartedDocs/python/flask.tsx b/static/app/gettingStartedDocs/python/flask.tsx index 0afb0cd8ea3d7c..8b11135bd0f998 100644 --- a/static/app/gettingStartedDocs/python/flask.tsx +++ b/static/app/gettingStartedDocs/python/flask.tsx @@ -41,19 +41,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/gcpfunctions.spec.tsx b/static/app/gettingStartedDocs/python/gcpfunctions.spec.tsx index 807da1c0146101..0d17035ae4721b 100644 --- a/static/app/gettingStartedDocs/python/gcpfunctions.spec.tsx +++ b/static/app/gettingStartedDocs/python/gcpfunctions.spec.tsx @@ -28,7 +28,7 @@ describe('gcpfunctions onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -42,14 +42,15 @@ describe('gcpfunctions onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config expect( - screen.getByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).toBeInTheDocument(); }); @@ -68,12 +69,15 @@ describe('gcpfunctions onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config expect( - screen.getByText(textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).toBeInTheDocument(); + expect( + screen.getByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).toBeInTheDocument(); }); }); diff --git a/static/app/gettingStartedDocs/python/gcpfunctions.tsx b/static/app/gettingStartedDocs/python/gcpfunctions.tsx index bb2baeee11a65e..642757e32ae557 100644 --- a/static/app/gettingStartedDocs/python/gcpfunctions.tsx +++ b/static/app/gettingStartedDocs/python/gcpfunctions.tsx @@ -41,19 +41,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/python.spec.tsx b/static/app/gettingStartedDocs/python/python.spec.tsx index 0306d5ae975343..60ee471b9add3c 100644 --- a/static/app/gettingStartedDocs/python/python.spec.tsx +++ b/static/app/gettingStartedDocs/python/python.spec.tsx @@ -28,7 +28,7 @@ describe('python onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -50,7 +50,7 @@ describe('python onboarding docs', function () { // Does render transaction profiling config expect( - screen.getByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).toBeInTheDocument(); }); @@ -69,7 +69,7 @@ describe('python onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config diff --git a/static/app/gettingStartedDocs/python/python.tsx b/static/app/gettingStartedDocs/python/python.tsx index 42b16927691d02..721e7c961741d8 100644 --- a/static/app/gettingStartedDocs/python/python.tsx +++ b/static/app/gettingStartedDocs/python/python.tsx @@ -155,11 +155,17 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_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' + ? ` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0,` + : '' } )${ params.isProfilingSelected && @@ -179,10 +185,11 @@ def fast_function(): # Manually call start_profiler and stop_profiler # to profile the code in between sentry_sdk.profiler.start_profiler() + for i in range(0, 10): slow_function() fast_function() -# + # Calls to stop_profiler are optional - if you don't stop the profiler, it will keep profiling # your application until the process exits or stop_profiler is called. sentry_sdk.profiler.stop_profiler()` diff --git a/static/app/gettingStartedDocs/python/quart.spec.tsx b/static/app/gettingStartedDocs/python/quart.spec.tsx index 221b591fcf50ae..a83b2e19d3a914 100644 --- a/static/app/gettingStartedDocs/python/quart.spec.tsx +++ b/static/app/gettingStartedDocs/python/quart.spec.tsx @@ -30,7 +30,7 @@ describe('quart onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -44,14 +44,15 @@ describe('quart onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config const matches = screen.getAllByText( - textWithMarkupMatcher(/profiles_sample_rate=1\.0,/) + textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/) ); expect(matches.length).toBeGreaterThan(0); matches.forEach(match => expect(match).toBeInTheDocument()); @@ -72,14 +73,19 @@ describe('quart onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate: 1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate: 1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config - const matches = screen.getAllByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) + const sampleRateMatches = screen.getAllByText( + textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/) ); - expect(matches.length).toBeGreaterThan(0); - matches.forEach(match => expect(match).toBeInTheDocument()); + expect(sampleRateMatches.length).toBeGreaterThan(0); + sampleRateMatches.forEach(match => expect(match).toBeInTheDocument()); + const lifeCycleMatches = screen.getAllByText( + textWithMarkupMatcher(/profile_lifecycle="trace",/) + ); + expect(lifeCycleMatches.length).toBeGreaterThan(0); + lifeCycleMatches.forEach(match => expect(match).toBeInTheDocument()); }); }); diff --git a/static/app/gettingStartedDocs/python/quart.tsx b/static/app/gettingStartedDocs/python/quart.tsx index 18e5f6dcb54278..63dd1b6c6b4818 100644 --- a/static/app/gettingStartedDocs/python/quart.tsx +++ b/static/app/gettingStartedDocs/python/quart.tsx @@ -42,19 +42,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/rq.spec.tsx b/static/app/gettingStartedDocs/python/rq.spec.tsx index 442fbf23894813..8e87ff1f8a2ed4 100644 --- a/static/app/gettingStartedDocs/python/rq.spec.tsx +++ b/static/app/gettingStartedDocs/python/rq.spec.tsx @@ -33,7 +33,7 @@ describe('rq onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -47,15 +47,15 @@ describe('rq onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText(textWithMarkupMatcher(/sentry_sdk.profiler.start_profiler\(\)/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0/)) ).not.toBeInTheDocument(); expect( - screen.queryByText(textWithMarkupMatcher(/sentry_sdk.profiler.stop_profiler\(\)/)) + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace"/)) ).not.toBeInTheDocument(); // Does render transaction profiling config const matches = screen.getAllByText( - textWithMarkupMatcher(/profiles_sample_rate=1\.0,/) + textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/) ); expect(matches.length).toBeGreaterThan(0); matches.forEach(match => expect(match).toBeInTheDocument()); @@ -76,20 +76,19 @@ describe('rq onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config - const startMatches = screen.queryAllByText( - textWithMarkupMatcher(/sentry_sdk.profiler.start_profiler\(\)/) + const sampleRateMatches = screen.getAllByText( + textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/) ); - expect(startMatches.length).toBeGreaterThan(0); - startMatches.forEach(match => expect(match).toBeInTheDocument()); - - const stopMatches = screen.queryAllByText( - textWithMarkupMatcher(/sentry_sdk.profiler.stop_profiler\(\)/) + expect(sampleRateMatches.length).toBeGreaterThan(0); + sampleRateMatches.forEach(match => expect(match).toBeInTheDocument()); + const lifeCycleMatches = screen.getAllByText( + textWithMarkupMatcher(/profile_lifecycle="trace",/) ); - expect(stopMatches.length).toBeGreaterThan(0); - stopMatches.forEach(match => expect(match).toBeInTheDocument()); + expect(lifeCycleMatches.length).toBeGreaterThan(0); + lifeCycleMatches.forEach(match => expect(match).toBeInTheDocument()); }); }); diff --git a/static/app/gettingStartedDocs/python/rq.tsx b/static/app/gettingStartedDocs/python/rq.tsx index eff718180018ea..01037f3c18af1a 100644 --- a/static/app/gettingStartedDocs/python/rq.tsx +++ b/static/app/gettingStartedDocs/python/rq.tsx @@ -33,27 +33,23 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_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' + ? ` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` + : '' } -)${ - params.isProfilingSelected && - params.profilingOptions?.defaultProfilingMode === 'continuous' - ? ` - -# Manually call start_profiler and stop_profiler -# to profile the code in between -sentry_sdk.profiler.start_profiler() -# this code will be profiled -# -# Calls to stop_profiler are optional - if you don't stop the profiler, it will keep profiling -# your application until the process exits or stop_profiler is called. -sentry_sdk.profiler.stop_profiler()` - : '' -}`; +) +`; const getSdkSetupSnippet = (params: Params) => ` import sentry_sdk diff --git a/static/app/gettingStartedDocs/python/serverless.spec.tsx b/static/app/gettingStartedDocs/python/serverless.spec.tsx index d7e2f417970f11..6fc092b706cb43 100644 --- a/static/app/gettingStartedDocs/python/serverless.spec.tsx +++ b/static/app/gettingStartedDocs/python/serverless.spec.tsx @@ -28,7 +28,7 @@ describe('serverless onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -42,14 +42,15 @@ describe('serverless onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config expect( - screen.getByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).toBeInTheDocument(); }); @@ -68,12 +69,15 @@ describe('serverless onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config expect( - screen.getByText(textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).toBeInTheDocument(); + expect( + screen.getByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).toBeInTheDocument(); }); }); diff --git a/static/app/gettingStartedDocs/python/serverless.tsx b/static/app/gettingStartedDocs/python/serverless.tsx index a5d772da3a0dee..126cf78e120278 100644 --- a/static/app/gettingStartedDocs/python/serverless.tsx +++ b/static/app/gettingStartedDocs/python/serverless.tsx @@ -37,19 +37,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/starlette.spec.tsx b/static/app/gettingStartedDocs/python/starlette.spec.tsx index bc794efeafd730..d54282447a92e2 100644 --- a/static/app/gettingStartedDocs/python/starlette.spec.tsx +++ b/static/app/gettingStartedDocs/python/starlette.spec.tsx @@ -30,7 +30,7 @@ describe('starlette onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -44,14 +44,15 @@ describe('starlette onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config const matches = screen.getAllByText( - textWithMarkupMatcher(/profiles_sample_rate=1\.0,/) + textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/) ); expect(matches.length).toBeGreaterThan(0); matches.forEach(match => expect(match).toBeInTheDocument()); @@ -72,14 +73,19 @@ describe('starlette onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate: 1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate: 1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config - const matches = screen.getAllByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) + const sampleRateMatches = screen.getAllByText( + textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/) ); - expect(matches.length).toBeGreaterThan(0); - matches.forEach(match => expect(match).toBeInTheDocument()); + expect(sampleRateMatches.length).toBeGreaterThan(0); + sampleRateMatches.forEach(match => expect(match).toBeInTheDocument()); + const lifeCycleMatches = screen.getAllByText( + textWithMarkupMatcher(/profile_lifecycle="trace",/) + ); + expect(lifeCycleMatches.length).toBeGreaterThan(0); + lifeCycleMatches.forEach(match => expect(match).toBeInTheDocument()); }); }); diff --git a/static/app/gettingStartedDocs/python/starlette.tsx b/static/app/gettingStartedDocs/python/starlette.tsx index c023a54bea12ee..c21be6ee9852e4 100644 --- a/static/app/gettingStartedDocs/python/starlette.tsx +++ b/static/app/gettingStartedDocs/python/starlette.tsx @@ -40,19 +40,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/tornado.spec.tsx b/static/app/gettingStartedDocs/python/tornado.spec.tsx index 87485729e529b8..8edc7bf8955368 100644 --- a/static/app/gettingStartedDocs/python/tornado.spec.tsx +++ b/static/app/gettingStartedDocs/python/tornado.spec.tsx @@ -28,7 +28,7 @@ describe('tornado onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -42,14 +42,15 @@ describe('tornado onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config const matches = screen.getAllByText( - textWithMarkupMatcher(/profiles_sample_rate=1\.0,/) + textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/) ); expect(matches.length).toBeGreaterThan(0); matches.forEach(match => expect(match).toBeInTheDocument()); @@ -70,14 +71,19 @@ describe('tornado onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate: 1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate: 1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config - const matches = screen.getAllByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) + const sampleRateMatches = screen.getAllByText( + textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/) ); - expect(matches.length).toBeGreaterThan(0); - matches.forEach(match => expect(match).toBeInTheDocument()); + expect(sampleRateMatches.length).toBeGreaterThan(0); + sampleRateMatches.forEach(match => expect(match).toBeInTheDocument()); + const lifeCycleMatches = screen.getAllByText( + textWithMarkupMatcher(/profile_lifecycle="trace",/) + ); + expect(lifeCycleMatches.length).toBeGreaterThan(0); + lifeCycleMatches.forEach(match => expect(match).toBeInTheDocument()); }); }); diff --git a/static/app/gettingStartedDocs/python/tornado.tsx b/static/app/gettingStartedDocs/python/tornado.tsx index 7091228c31e724..4045ec96b35ee7 100644 --- a/static/app/gettingStartedDocs/python/tornado.tsx +++ b/static/app/gettingStartedDocs/python/tornado.tsx @@ -39,19 +39,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/tryton.spec.tsx b/static/app/gettingStartedDocs/python/tryton.spec.tsx index 69f928b2d40604..93a04bfc8a35f3 100644 --- a/static/app/gettingStartedDocs/python/tryton.spec.tsx +++ b/static/app/gettingStartedDocs/python/tryton.spec.tsx @@ -21,7 +21,7 @@ describe('tryton onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -35,14 +35,15 @@ describe('tryton onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config expect( - screen.getByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).toBeInTheDocument(); }); @@ -61,12 +62,15 @@ describe('tryton onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config expect( - screen.getByText(textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).toBeInTheDocument(); + expect( + screen.getByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).toBeInTheDocument(); }); }); diff --git a/static/app/gettingStartedDocs/python/tryton.tsx b/static/app/gettingStartedDocs/python/tryton.tsx index 72f247d2402bfc..7a313c69295e47 100644 --- a/static/app/gettingStartedDocs/python/tryton.tsx +++ b/static/app/gettingStartedDocs/python/tryton.tsx @@ -33,19 +33,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } ) diff --git a/static/app/gettingStartedDocs/python/wsgi.spec.tsx b/static/app/gettingStartedDocs/python/wsgi.spec.tsx index b7aac850132c6c..6e54a33fa12b8d 100644 --- a/static/app/gettingStartedDocs/python/wsgi.spec.tsx +++ b/static/app/gettingStartedDocs/python/wsgi.spec.tsx @@ -28,7 +28,7 @@ describe('wsgi onboarding docs', function () { // Does not render config option expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does not render config option @@ -42,14 +42,15 @@ describe('wsgi onboarding docs', function () { // Does not render continuous profiling config expect( - screen.queryByText( - textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/) - ) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).not.toBeInTheDocument(); + expect( + screen.queryByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).not.toBeInTheDocument(); // Does render transaction profiling config expect( - screen.getByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).toBeInTheDocument(); }); @@ -68,12 +69,15 @@ describe('wsgi onboarding docs', function () { // Does not render transaction profiling config expect( - screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/)) + screen.queryByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) ).not.toBeInTheDocument(); // Does render continuous profiling config expect( - screen.getByText(textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/)) + screen.getByText(textWithMarkupMatcher(/profile_session_sample_rate=1\.0,/)) + ).toBeInTheDocument(); + expect( + screen.getByText(textWithMarkupMatcher(/profile_lifecycle="trace",/)) ).toBeInTheDocument(); }); }); diff --git a/static/app/gettingStartedDocs/python/wsgi.tsx b/static/app/gettingStartedDocs/python/wsgi.tsx index 402f9ac2211d7a..68750f61c5a8eb 100644 --- a/static/app/gettingStartedDocs/python/wsgi.tsx +++ b/static/app/gettingStartedDocs/python/wsgi.tsx @@ -39,19 +39,19 @@ sentry_sdk.init( params.isProfilingSelected && params.profilingOptions?.defaultProfilingMode !== 'continuous' ? ` - # Set profiles_sample_rate to 1.0 to profile 100% + # Set profile_session_sample_rate to 1.0 to profile 100% # of sampled transactions. # We recommend adjusting this value in production. - profiles_sample_rate=1.0,` + profile_session_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, - },` + # Set profile_session_sample_rate to 1.0 to profile 100% + # of profile sessions. + profile_session_sample_rate=1.0, + # Set profile_lifecycle to "trace" to automatically + # run the profiler on when there is an active transaction + profile_lifecycle="trace",` : '' } )