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] Added new option http_methods_to_capture to Starlette and FastAPI docs. #11349

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
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
18 changes: 16 additions & 2 deletions docs/platforms/python/integrations/fastapi/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ sentry_sdk.init(
StarletteIntegration(
transaction_style="endpoint",
failed_request_status_codes=[403, range(500, 599)],
http_methods_to_capture=("GET",),
),
FastApiIntegration(
transaction_style="endpoint",
failed_request_status_codes=[403, range(500, 599)],
http_methods_to_capture=("GET",),
),
]
)
Expand All @@ -106,10 +108,10 @@ You can pass the following keyword arguments to `StarletteIntegration()` and `Fa
# ...
integrations=[
StarletteIntegration(
transaction_style="endpoint"
transaction_style="endpoint",
),
FastApiIntegration(
transaction_style="endpoint"
transaction_style="endpoint",
),
],
)
Expand Down Expand Up @@ -141,6 +143,18 @@ You can pass the following keyword arguments to `StarletteIntegration()` and `Fa

The default is `[range(500, 599)]`.

- `http_methods_to_capture`:

A tuple containing all the HTTP methods that should create a transaction in Sentry.

The default is `("CONNECT", "DELETE", "GET", "PATCH", "POST", "PUT", "TRACE",)`.

(Note that `OPTIONS` and `HEAD` are missing by default.)

<Alert title="Added in 2.15.0" level="info">
The `http_methods_to_capture` option.
</Alert>

## Supported Versions

- FastAPI: 0.79.0+
Expand Down
13 changes: 13 additions & 0 deletions docs/platforms/python/integrations/starlette/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ sentry_sdk.init(
transaction_style="endpoint",
failed_request_status_codes=[403, range(500, 599)],
middleware_spans=False,
http_methods_to_capture=("GET",),
)
],
)
Expand Down Expand Up @@ -105,6 +106,18 @@ You can pass the following keyword arguments to `StarletteIntegration()`:

The default is `True`.

- `http_methods_to_capture`:

A tuple containing all the HTTP methods that should create a transaction in Sentry.

The default is `("CONNECT", "DELETE", "GET", "PATCH", "POST", "PUT", "TRACE",)`.

(Note that `OPTIONS` and `HEAD` are missing by default.)

<Alert title="Added in 2.15.0" level="info">
The `http_methods_to_capture` option.
</Alert>

## Supported Versions

- Starlette: 0.19.1+
Expand Down
Loading