Skip to content

Commit 9b49e31

Browse files
authored
[Python] Added new option http_methods_to_capture to Flask and Django docs. (#11348)
1 parent 04fcb70 commit 9b49e31

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

docs/platforms/python/integrations/django/index.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ sentry_sdk.init(
116116
django.db.models.signals.post_init,
117117
],
118118
cache_spans=False,
119+
http_methods_to_capture=("GET",),
119120
),
120121
],
121122
)
@@ -156,6 +157,18 @@ You can pass the following keyword arguments to `DjangoIntegration()`:
156157

157158
The default is `False`.
158159

160+
- `http_methods_to_capture`:
161+
162+
A tuple containing all the HTTP methods that should create a transaction in Sentry.
163+
164+
The default is `("CONNECT", "DELETE", "GET", "PATCH", "POST", "PUT", "TRACE",)`.
165+
166+
(Note that `OPTIONS` and `HEAD` are missing by default.)
167+
168+
<Alert title="Added in 2.15.0" level="info">
169+
The `http_methods_to_capture` option.
170+
</Alert>
171+
159172
## Supported Versions
160173

161174
- Django 1.11+

docs/platforms/python/integrations/flask/index.mdx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ sentry_sdk.init(
6767
integrations = [
6868
FlaskIntegration(
6969
transaction_style="url",
70+
http_methods_to_capture=("GET",),
7071
),
7172
],
7273
)
@@ -76,6 +77,9 @@ You can pass the following keyword arguments to `FlaskIntegration()`:
7677

7778
- `transaction_style`:
7879

80+
Sets the format or style that transactions are named.
81+
<br/>
82+
7983
```python
8084
@app.route("/myurl/<foo>")
8185
def myendpoint():
@@ -85,10 +89,22 @@ You can pass the following keyword arguments to `FlaskIntegration()`:
8589
In the above code, you would set the transaction to:
8690

8791
- `/myurl/<foo>` if you set `transaction_style="url"`.
88-
- `myendpoint` if you set `transaction_style="endpoint"`
92+
- `myendpoint` if you set `transaction_style="endpoint"`.
8993

9094
The default is `"endpoint"`.
9195

96+
- `http_methods_to_capture`:
97+
98+
A tuple containing all the HTTP methods that should create a transaction in Sentry.
99+
100+
The default is `("CONNECT", "DELETE", "GET", "PATCH", "POST", "PUT", "TRACE",)`.
101+
102+
(Note that `OPTIONS` and `HEAD` are missing by default.)
103+
104+
<Alert title="Added in 2.15.0" level="info">
105+
The `http_methods_to_capture` option.
106+
</Alert>
107+
92108
## Supported Versions
93109

94110
- Flask: 1.0+

0 commit comments

Comments
 (0)