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 Flask and Django docs. #11348

Merged
merged 3 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
13 changes: 13 additions & 0 deletions docs/platforms/python/integrations/django/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ sentry_sdk.init(
django.db.models.signals.post_init,
],
cache_spans=False,
http_methods_to_capture=("GET",),
),
],
)
Expand Down Expand Up @@ -156,6 +157,18 @@ You can pass the following keyword arguments to `DjangoIntegration()`:

The default is `False`.

- `http_methods_to_capture`:

A set containing all the HTTP methods that should create a transaction in Sentry.
antonpirker marked this conversation as resolved.
Show resolved Hide resolved

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

- Django 1.11+
Expand Down
18 changes: 17 additions & 1 deletion docs/platforms/python/integrations/flask/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ sentry_sdk.init(
integrations = [
FlaskIntegration(
transaction_style="url",
http_methods_to_capture=("GET",),
),
],
)
Expand All @@ -76,6 +77,9 @@ You can pass the following keyword arguments to `FlaskIntegration()`:

- `transaction_style`:

Sets the format or style that transactions are named.
<br/>

```python
@app.route("/myurl/<foo>")
def myendpoint():
Expand All @@ -85,10 +89,22 @@ You can pass the following keyword arguments to `FlaskIntegration()`:
In the above code, you would set the transaction to:

- `/myurl/<foo>` if you set `transaction_style="url"`.
- `myendpoint` if you set `transaction_style="endpoint"`
- `myendpoint` if you set `transaction_style="endpoint"`.

The default is `"endpoint"`.

- `http_methods_to_capture`:

A set containing all the HTTP methods that should create a transaction in Sentry.
antonpirker marked this conversation as resolved.
Show resolved Hide resolved

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

- Flask: 1.0+
Expand Down
Loading