diff --git a/docs/platforms/python/index.mdx b/docs/platforms/python/index.mdx index 3b3e5fec36668..e1845a252c6e7 100644 --- a/docs/platforms/python/index.mdx +++ b/docs/platforms/python/index.mdx @@ -41,7 +41,7 @@ Configuration should happen as **early as possible** in your application's lifec -```python {"onboardingOptions": {"performance": "8-10", "profiling": "11-14"}} +```python import sentry_sdk sentry_sdk.init( @@ -49,13 +49,17 @@ sentry_sdk.init( # Add request headers and IP for users, # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling ) ``` diff --git a/docs/platforms/python/integrations/asgi/index.mdx b/docs/platforms/python/integrations/asgi/index.mdx index e43b1a0231a7b..cd58323880bdd 100644 --- a/docs/platforms/python/integrations/asgi/index.mdx +++ b/docs/platforms/python/integrations/asgi/index.mdx @@ -32,7 +32,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {"onboardingOptions": {"performance": "11-13", "profiling": "14-17"}} +```python import sentry_sdk from sentry_sdk.integrations.asgi import SentryAsgiMiddleware @@ -43,13 +43,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling ) app = SentryAsgiMiddleware(app) diff --git a/docs/platforms/python/integrations/asyncio/index.mdx b/docs/platforms/python/integrations/asyncio/index.mdx index 4df20143d69d1..b127b9eb942c3 100644 --- a/docs/platforms/python/integrations/asyncio/index.mdx +++ b/docs/platforms/python/integrations/asyncio/index.mdx @@ -29,7 +29,7 @@ If you call `sentry_sdk.init()` outside of an `async` function in an async appli ]} /> -```python {filename:main.py} {"onboardingOptions": {"performance": "10-12", "profiling": "13-16"}} +```python {filename:main.py} import sentry_sdk from sentry_sdk.integrations.asyncio import AsyncioIntegration @@ -39,13 +39,17 @@ async def main(): # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[ AsyncioIntegration(), ], diff --git a/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx b/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx index d29a0a3a487ff..d25729de84017 100644 --- a/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx +++ b/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx @@ -44,7 +44,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {"onboardingOptions": {"performance": "9-11", "profiling": "12-15"}} +```python import sentry_sdk from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration @@ -53,13 +53,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[ AwsLambdaIntegration(), ], diff --git a/docs/platforms/python/integrations/beam/index.mdx b/docs/platforms/python/integrations/beam/index.mdx index cc2005ed7b77f..6bdf2e56b6dbc 100644 --- a/docs/platforms/python/integrations/beam/index.mdx +++ b/docs/platforms/python/integrations/beam/index.mdx @@ -24,7 +24,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {"onboardingOptions": {"performance": "9-11", "profiling": "12-15"}} +```python import sentry_sdk from sentry_sdk.integrations.beam import BeamIntegration @@ -33,13 +33,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[ BeamIntegration(), ], diff --git a/docs/platforms/python/integrations/celery/crons.mdx b/docs/platforms/python/integrations/celery/crons.mdx index ce565d032d173..e6893a27fc5aa 100644 --- a/docs/platforms/python/integrations/celery/crons.mdx +++ b/docs/platforms/python/integrations/celery/crons.mdx @@ -50,7 +50,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori options={["error-monitoring", "performance", "profiling"]} /> -```python {diff} {filename:tasks.py} {"onboardingOptions": {"performance": "15-17", "profiling": "18-21"}} +```python {diff} {filename:tasks.py} # tasks.py from celery import signals @@ -65,13 +65,17 @@ def init_sentry(**kwargs): # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling + integrations=[ + CeleryIntegration( + monitor_beat_tasks=True diff --git a/docs/platforms/python/integrations/celery/index.mdx b/docs/platforms/python/integrations/celery/index.mdx index 2188d0da49c28..e883c501137f3 100644 --- a/docs/platforms/python/integrations/celery/index.mdx +++ b/docs/platforms/python/integrations/celery/index.mdx @@ -35,7 +35,7 @@ In addition to capturing errors, you can use Sentry for [distributed tracing](/c options={["error-monitoring", "performance", "profiling"]} /> -```python {filename:tasks.py} {"onboardingOptions": {"performance": "15-17", "profiling": "18-21"}} +```python {filename:tasks.py} from celery import Celery, signals import sentry_sdk @@ -50,13 +50,17 @@ def init_sentry(**_kwargs): # Add request headers and IP for users, # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling ) # Task definitions go here @@ -73,7 +77,7 @@ The [`celeryd_init`](https://docs.celeryq.dev/en/stable/userguide/signals.html?# options={["error-monitoring", "performance", "profiling"]} /> -```python {filename:main.py} {"onboardingOptions": {"performance": "11-13", "profiling": "14-17"}} +```python {filename:main.py} from tasks import add import sentry_sdk @@ -84,13 +88,17 @@ def main(): # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling ) # Enqueueing a task to be processed by Celery @@ -111,7 +119,7 @@ To confirm that your SDK is initialized on worker start, pass `debug=True` to `s The snippet below includes an intentional `ZeroDivisionError` in the Celery task that will be captured by Sentry. To trigger the error call `debug_sentry.delay()`: -```python {filename:tasks.py} {"onboardingOptions": {"performance": "12-14", "profiling": "15-18"}} +```python {filename:tasks.py} from celery import Celery, signals import sentry_sdk diff --git a/docs/platforms/python/integrations/cloudresourcecontext/index.mdx b/docs/platforms/python/integrations/cloudresourcecontext/index.mdx index 56af486ea4190..52ab916820e07 100644 --- a/docs/platforms/python/integrations/cloudresourcecontext/index.mdx +++ b/docs/platforms/python/integrations/cloudresourcecontext/index.mdx @@ -30,7 +30,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {"onboardingOptions": {"performance": "9-11", "profiling": "12-15"}} +```python import sentry_sdk from sentry_sdk.integrations.cloud_resource_context import CloudResourceContextIntegration @@ -39,13 +39,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[ CloudResourceContextIntegration(), ], diff --git a/docs/platforms/python/integrations/django/index.mdx b/docs/platforms/python/integrations/django/index.mdx index 3c6cb1f3f0059..298a4242dd005 100644 --- a/docs/platforms/python/integrations/django/index.mdx +++ b/docs/platforms/python/integrations/django/index.mdx @@ -37,7 +37,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {filename:settings.py} {"onboardingOptions": {"performance": "8-10", "profiling": "11-14"}} +```python {filename:settings.py} import sentry_sdk sentry_sdk.init( @@ -45,13 +45,17 @@ sentry_sdk.init( # Add data like request headers and IP for users; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling ) ``` diff --git a/docs/platforms/python/integrations/gcp-functions/index.mdx b/docs/platforms/python/integrations/gcp-functions/index.mdx index 3d42469c57efd..77e4c3ace7be3 100644 --- a/docs/platforms/python/integrations/gcp-functions/index.mdx +++ b/docs/platforms/python/integrations/gcp-functions/index.mdx @@ -35,7 +35,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {"onboardingOptions": {"performance": "9-11", "profiling": "12-15"}} +```python import sentry_sdk from sentry_sdk.integrations.gcp import GcpIntegration @@ -44,13 +44,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[ GcpIntegration(), ], diff --git a/docs/platforms/python/integrations/grpc/index.mdx b/docs/platforms/python/integrations/grpc/index.mdx index 55731a9027f7a..f769790dd8928 100644 --- a/docs/platforms/python/integrations/grpc/index.mdx +++ b/docs/platforms/python/integrations/grpc/index.mdx @@ -37,7 +37,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ### Server -```python {"onboardingOptions": {"performance": "11-13", "profiling": "14-17"}} +```python import grpc import sentry_sdk @@ -48,13 +48,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[ GRPCIntegration(), ], @@ -72,7 +76,7 @@ server = grpc.aio.server() ### Client -```python {"onboardingOptions": {"performance": "8-10", "profiling": "11-14"}} +```python import grpc import sentry_sdk @@ -83,13 +87,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[ GRPCIntegration(), ], diff --git a/docs/platforms/python/integrations/langchain/index.mdx b/docs/platforms/python/integrations/langchain/index.mdx index 4c6626576b095..87cf73114d132 100644 --- a/docs/platforms/python/integrations/langchain/index.mdx +++ b/docs/platforms/python/integrations/langchain/index.mdx @@ -43,7 +43,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {"onboardingOptions": {"performance": "9-11", "profiling": "12-15"}} +```python import sentry_sdk sentry_sdk.init( @@ -51,13 +51,17 @@ sentry_sdk.init( # Send personally-identifiable information like LLM responses to Sentry; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for performance monitoring. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling ) ``` diff --git a/docs/platforms/python/integrations/litestar/index.mdx b/docs/platforms/python/integrations/litestar/index.mdx index 0d85da162370d..dc23d6be2c63c 100644 --- a/docs/platforms/python/integrations/litestar/index.mdx +++ b/docs/platforms/python/integrations/litestar/index.mdx @@ -29,7 +29,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {"onboardingOptions": {"performance": "9-11", "profiling": "12-15"}} +```python import sentry_sdk sentry_sdk.init( @@ -37,13 +37,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling ) ``` diff --git a/docs/platforms/python/integrations/ray/index.mdx b/docs/platforms/python/integrations/ray/index.mdx index 6f9c963df8d9d..a3425de766e01 100644 --- a/docs/platforms/python/integrations/ray/index.mdx +++ b/docs/platforms/python/integrations/ray/index.mdx @@ -26,7 +26,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori options={["error-monitoring", "performance", "profiling"]} /> -```python {"onboardingOptions": {"performance": "12-14", "profiling": "15-18"}} +```python import ray import sentry_sdk @@ -38,13 +38,17 @@ def init_sentry(): # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[ RayIntegration(), ], diff --git a/docs/platforms/python/integrations/rq/index.mdx b/docs/platforms/python/integrations/rq/index.mdx index c11d5e19009ff..7c3fb8b03435c 100644 --- a/docs/platforms/python/integrations/rq/index.mdx +++ b/docs/platforms/python/integrations/rq/index.mdx @@ -32,7 +32,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {filename:mysettings.py} {"onboardingOptions": {"performance": "9-11", "profiling": "12-15"}} +```python {filename:mysettings.py} # mysettings.py import sentry_sdk @@ -41,13 +41,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling ) ``` @@ -66,7 +70,7 @@ Generally, make sure that the **call to `init` is loaded on worker startup**, an In addition, make sure that **`init` is called only once** in your app. For example, if you have a `Flask` app and a worker that depends on the app, we recommend only initializing Sentry once. Note that because the Flask integration is enabled automatically, you don't need to change the configuration shown above. -```python {filename:app.py} {"onboardingOptions": {"performance": "9-11", "profiling": "12-15"}} +```python {filename:app.py} # app.py import sentry_sdk @@ -75,13 +79,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling ) ``` @@ -108,7 +116,7 @@ def hello(name): ### Settings for worker -```python {filename:mysettings.py} {"onboardingOptions": {"performance": "10-12", "profiling": "13-16"}} +```python {filename:mysettings.py} # mysettings.py import sentry_sdk @@ -118,19 +126,23 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling ) ``` ### Main Python Script -```python {filename:main.py} {"onboardingOptions": {"performance": "18-20", "profiling": "21-24"}} +```python {filename:main.py} # main.py from redis import Redis from rq import Queue @@ -145,13 +157,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling ) q = Queue(connection=Redis()) diff --git a/docs/platforms/python/integrations/rust_tracing/index.mdx b/docs/platforms/python/integrations/rust_tracing/index.mdx index 2ec02caa70631..6a9201d21802c 100644 --- a/docs/platforms/python/integrations/rust_tracing/index.mdx +++ b/docs/platforms/python/integrations/rust_tracing/index.mdx @@ -68,7 +68,7 @@ Create an instance of `RustTracingIntegration` and add it to your list of integr ]} /> -```python {filename:main.py} {"onboardingOptions": {"performance": "12-14", "profiling": "15-18"}} +```python {filename:main.py} import sentry_sdk from sentry_sdk.integrations.rust_tracing import RustTracingIntegration @@ -80,13 +80,17 @@ async def main(): # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[ RustTracingIntegration( "my_rust_extension", diff --git a/docs/platforms/python/integrations/sanic/index.mdx b/docs/platforms/python/integrations/sanic/index.mdx index 99347bdb44bba..b17cc6c213a77 100644 --- a/docs/platforms/python/integrations/sanic/index.mdx +++ b/docs/platforms/python/integrations/sanic/index.mdx @@ -40,7 +40,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {"onboardingOptions": {"performance": "14-17", "profiling": "17-20"}} +```python from sanic import Sanic import sentry_sdk from sentry_sdk.integrations.asyncio import AsyncioIntegration @@ -54,13 +54,17 @@ async def init_sentry(_): # Add data like request headers and IP for users; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[AsyncioIntegration()], ) ``` diff --git a/docs/platforms/python/integrations/serverless/index.mdx b/docs/platforms/python/integrations/serverless/index.mdx index a8eb71db50189..a869240216024 100644 --- a/docs/platforms/python/integrations/serverless/index.mdx +++ b/docs/platforms/python/integrations/serverless/index.mdx @@ -37,7 +37,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {"onboardingOptions": {"performance": "9-11", "profiling": "12-15"}} +```python import sentry_sdk from sentry_sdk.integrations.serverless import serverless_function @@ -46,13 +46,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling ) @serverless_function diff --git a/docs/platforms/python/integrations/socket/index.mdx b/docs/platforms/python/integrations/socket/index.mdx index a1564f6e3d354..25b952d2d4d6f 100644 --- a/docs/platforms/python/integrations/socket/index.mdx +++ b/docs/platforms/python/integrations/socket/index.mdx @@ -30,7 +30,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {"onboardingOptions": {"performance": "9-11", "profiling": "12-15"}} +```python import sentry_sdk from sentry_sdk.integrations.socket import SocketIntegration @@ -39,13 +39,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[ SocketIntegration(), ], diff --git a/docs/platforms/python/integrations/spark/index.mdx b/docs/platforms/python/integrations/spark/index.mdx index 4a0441e7ce43c..9cd14c4bf651b 100644 --- a/docs/platforms/python/integrations/spark/index.mdx +++ b/docs/platforms/python/integrations/spark/index.mdx @@ -26,7 +26,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {"onboardingOptions": {"performance": "10-12", "profiling": "13-16"}} +```python import sentry_sdk from sentry_sdk.integrations.spark import SparkIntegration @@ -36,13 +36,17 @@ if __name__ == "__main__": # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[ SparkIntegration(), ], @@ -62,7 +66,7 @@ The spark worker integration is supported for Spark versions 2.4.x and 3.1.x. Create a file called `sentry-daemon.py` with the following content: -```python {filename:sentry-daemon.py} {"onboardingOptions": {"performance": "11-13", "profiling": "14-17"}} +```python {filename:sentry-daemon.py} import sentry_sdk from sentry_sdk.integrations.spark import SparkWorkerIntegration import pyspark.daemon as original_daemon @@ -73,13 +77,17 @@ if __name__ == '__main__': # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[ SparkWorkerIntegration(), ], diff --git a/docs/platforms/python/integrations/strawberry/index.mdx b/docs/platforms/python/integrations/strawberry/index.mdx index 0c3a6cad27e93..ea3276d299af0 100644 --- a/docs/platforms/python/integrations/strawberry/index.mdx +++ b/docs/platforms/python/integrations/strawberry/index.mdx @@ -32,7 +32,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {"onboardingOptions": {"performance": "9-11", "profiling": "12-15"}} +```python import sentry_sdk from sentry_sdk.integrations.strawberry import StrawberryIntegration @@ -41,13 +41,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[ StrawberryIntegration( # Set async_execution to True if you have diff --git a/docs/platforms/python/integrations/tryton/index.mdx b/docs/platforms/python/integrations/tryton/index.mdx index 0336a1561967e..2f1c00f90b652 100644 --- a/docs/platforms/python/integrations/tryton/index.mdx +++ b/docs/platforms/python/integrations/tryton/index.mdx @@ -22,7 +22,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {filename:wsgi.py} {"onboardingOptions": {"performance": "10-12", "profiling": "13-16"}} +```python {filename:wsgi.py} # wsgi.py import sentry_sdk from sentry_sdk.integrations.trytond import TrytondWSGIIntegration @@ -32,13 +32,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling integrations=[ TrytondWSGIIntegration(), ], diff --git a/docs/platforms/python/integrations/wsgi/index.mdx b/docs/platforms/python/integrations/wsgi/index.mdx index 680e155521d2c..41473f57df260 100644 --- a/docs/platforms/python/integrations/wsgi/index.mdx +++ b/docs/platforms/python/integrations/wsgi/index.mdx @@ -31,7 +31,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori ]} /> -```python {"onboardingOptions": {"performance": "11-13", "profiling": "14-17"}} +```python import sentry_sdk from sentry_sdk.integrations.wsgi import SentryWsgiMiddleware @@ -42,13 +42,17 @@ sentry_sdk.init( # Add data like request headers and IP for users, if applicable; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + # ___PRODUCT_OPTION_START___ performance # Set traces_sample_rate to 1.0 to capture 100% # of transactions for tracing. traces_sample_rate=1.0, + # ___PRODUCT_OPTION_END___ performance + # ___PRODUCT_OPTION_START___ profiling # 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, + # ___PRODUCT_OPTION_END___ profiling ) app = SentryWsgiMiddleware(app)