Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/platforms/python/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,25 @@ Configuration should happen as early as possible in your application's lifecycle



```python {"onboardingOptions": {"performance": "8-10", "profiling": "11-14"}}
```python
import sentry_sdk

sentry_sdk.init(
dsn="___PUBLIC_DSN___",
# 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
)
```

Expand Down
6 changes: 5 additions & 1 deletion docs/platforms/python/integrations/asgi/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion docs/platforms/python/integrations/asyncio/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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(),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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(),
],
Expand Down
6 changes: 5 additions & 1 deletion docs/platforms/python/integrations/beam/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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(),
],
Expand Down
6 changes: 5 additions & 1 deletion docs/platforms/python/integrations/celery/crons.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/platforms/python/integrations/celery/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -73,7 +73,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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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(),
],
Expand Down
6 changes: 5 additions & 1 deletion docs/platforms/python/integrations/django/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,25 @@ 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(
dsn="___PUBLIC_DSN___",
# 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
)
```

Expand Down
6 changes: 5 additions & 1 deletion docs/platforms/python/integrations/gcp-functions/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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(),
],
Expand Down
2 changes: 1 addition & 1 deletion docs/platforms/python/integrations/grpc/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion docs/platforms/python/integrations/langchain/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,25 @@ 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(
dsn="___PUBLIC_DSN___",
# 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
)
```

Expand Down
9 changes: 8 additions & 1 deletion docs/platforms/python/integrations/litestar/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,28 @@ 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(
dsn="___PUBLIC_DSN___",
# 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=[
LitestarIntegration(),
],
)
```

Expand Down
6 changes: 5 additions & 1 deletion docs/platforms/python/integrations/ray/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(),
],
Expand Down
Loading