From ba35a6ef0942698741ce046219b713ff212a5983 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Fri, 13 Sep 2024 08:33:30 +0200 Subject: [PATCH 1/2] Added new option http_methods_to_capture to Flask and Django docs --- .../platforms/python/integrations/django/index.mdx | 10 ++++++++++ docs/platforms/python/integrations/flask/index.mdx | 14 +++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/platforms/python/integrations/django/index.mdx b/docs/platforms/python/integrations/django/index.mdx index 5e16739a1a3cc..e7c118ed45861 100644 --- a/docs/platforms/python/integrations/django/index.mdx +++ b/docs/platforms/python/integrations/django/index.mdx @@ -116,6 +116,7 @@ sentry_sdk.init( django.db.models.signals.post_init, ], cache_spans=False, + http_methods_to_capture=("GET",), ), ], ) @@ -156,6 +157,15 @@ 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. + + The default is `("CONNECT", "DELETE", "GET", "PATCH", "POST", "PUT", "TRACE",)`. + + (Note that `OPTIONS` and `HEAD` are missing by default.) + + ## Supported Versions - Django 1.11+ diff --git a/docs/platforms/python/integrations/flask/index.mdx b/docs/platforms/python/integrations/flask/index.mdx index 135cc7e8af1f5..c4dcc1c7e4534 100644 --- a/docs/platforms/python/integrations/flask/index.mdx +++ b/docs/platforms/python/integrations/flask/index.mdx @@ -67,6 +67,7 @@ sentry_sdk.init( integrations = [ FlaskIntegration( transaction_style="url", + http_methods_to_capture=("GET",), ), ], ) @@ -76,6 +77,9 @@ You can pass the following keyword arguments to `FlaskIntegration()`: - `transaction_style`: + Sets the format or style that transactions are named. +
+ ```python @app.route("/myurl/") def myendpoint(): @@ -85,10 +89,18 @@ You can pass the following keyword arguments to `FlaskIntegration()`: In the above code, you would set the transaction to: - `/myurl/` 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. + + The default is `("CONNECT", "DELETE", "GET", "PATCH", "POST", "PUT", "TRACE",)`. + + (Note that `OPTIONS` and `HEAD` are missing by default.) + ## Supported Versions - Flask: 1.0+ From d4905b39089fe04cdabf48de4be80393589a2d9e Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Fri, 13 Sep 2024 08:41:31 +0200 Subject: [PATCH 2/2] Added version when the parameter was added --- docs/platforms/python/integrations/django/index.mdx | 3 +++ docs/platforms/python/integrations/flask/index.mdx | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/docs/platforms/python/integrations/django/index.mdx b/docs/platforms/python/integrations/django/index.mdx index e7c118ed45861..eb70f74a199ac 100644 --- a/docs/platforms/python/integrations/django/index.mdx +++ b/docs/platforms/python/integrations/django/index.mdx @@ -165,6 +165,9 @@ You can pass the following keyword arguments to `DjangoIntegration()`: (Note that `OPTIONS` and `HEAD` are missing by default.) + + The `http_methods_to_capture` option. + ## Supported Versions diff --git a/docs/platforms/python/integrations/flask/index.mdx b/docs/platforms/python/integrations/flask/index.mdx index c4dcc1c7e4534..8f8e6598a8d27 100644 --- a/docs/platforms/python/integrations/flask/index.mdx +++ b/docs/platforms/python/integrations/flask/index.mdx @@ -101,6 +101,10 @@ You can pass the following keyword arguments to `FlaskIntegration()`: (Note that `OPTIONS` and `HEAD` are missing by default.) + + The `http_methods_to_capture` option. + + ## Supported Versions - Flask: 1.0+