Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: Documented that Pyramid is auto enabling #7911

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Changes from all commits
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
25 changes: 20 additions & 5 deletions src/platforms/python/guides/pyramid/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,18 @@ pip install --upgrade sentry-sdk

## Configure

To configure the SDK, initialize it with the integration before or after your app has been created:
If you have the `pyramid` package in your dependencies, the Pyramid integration will be enabled automatically when you initialize the Sentry SDK.

<SignInNote />

```python
import sentry_sdk
from sentry_sdk.integrations.pyramid import PyramidIntegration

sentry_sdk.init(
dsn="___PUBLIC_DSN___",
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
traces_sample_rate=1.0,
integrations=[
PyramidIntegration(),
],
)

from pyramid.config import Configurator
Expand Down Expand Up @@ -86,6 +82,25 @@ When you point your browser to [http://localhost:6543/](http://localhost:6543/)

## Options

By adding `PyramidIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `PyramidIntegration` to change its behavior:

```python
import sentry_sdk
from sentry_sdk.integrations.pyramid import PyramidIntegration

sentry_sdk.init(
dsn="___PUBLIC_DSN___",
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
traces_sample_rate=1.0,
integrations=[
PyramidIntegration(
transaction_style="route_pattern",
)
]
)
```

You can pass the following keyword arguments to `PyramidIntegration()`:

- `transaction_style`:
Expand Down
Loading