From ea971724ec0bd242a2f931af71b4ff725531f595 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Thu, 17 Oct 2024 13:10:20 +0200 Subject: [PATCH 1/3] Document failed_request_status_codes option better --- docs/platforms/python/integrations/fastapi/index.mdx | 3 +++ docs/platforms/python/integrations/starlette/index.mdx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/platforms/python/integrations/fastapi/index.mdx b/docs/platforms/python/integrations/fastapi/index.mdx index 4235e97c77f15..5df33eb142007 100644 --- a/docs/platforms/python/integrations/fastapi/index.mdx +++ b/docs/platforms/python/integrations/fastapi/index.mdx @@ -134,6 +134,9 @@ You can pass the following keyword arguments to `StarletteIntegration()` and `Fa A `set` of integers that will determine which status codes should be reported to Sentry. + The `failed_request_status_codes` option only controls whether [`HTTPException`](https://www.starlette.io/exceptions/#httpexception) exceptions should be + reported to Sentry. Other unhandled exceptions, which do not have a `status_code` attribute, are always reported to Sentry. + Examples of valid `failed_request_status_codes`: - `{500}` will only send events on HTTP 500. diff --git a/docs/platforms/python/integrations/starlette/index.mdx b/docs/platforms/python/integrations/starlette/index.mdx index d370efa1f2dcc..2337d894438c3 100644 --- a/docs/platforms/python/integrations/starlette/index.mdx +++ b/docs/platforms/python/integrations/starlette/index.mdx @@ -91,6 +91,9 @@ You can pass the following keyword arguments to `StarletteIntegration()`: A `set` of integers that will determine which status codes should be reported to Sentry. + The `failed_request_status_codes` option only controls whether [`HTTPException`](https://www.starlette.io/exceptions/#httpexception) exceptions should be + reported to Sentry. Other unhandled exceptions, which do not have a `status_code` attribute, are always reported to Sentry. + Examples of valid `failed_request_status_codes`: - `{500}` will only send events on HTTP 500. From ad52cd44ef07a6718852a27dc194da5715308a2f Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Thu, 17 Oct 2024 13:55:23 +0200 Subject: [PATCH 2/3] Fixed link --- docs/platforms/python/integrations/fastapi/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/python/integrations/fastapi/index.mdx b/docs/platforms/python/integrations/fastapi/index.mdx index 5df33eb142007..d5f93b621537a 100644 --- a/docs/platforms/python/integrations/fastapi/index.mdx +++ b/docs/platforms/python/integrations/fastapi/index.mdx @@ -134,7 +134,7 @@ You can pass the following keyword arguments to `StarletteIntegration()` and `Fa A `set` of integers that will determine which status codes should be reported to Sentry. - The `failed_request_status_codes` option only controls whether [`HTTPException`](https://www.starlette.io/exceptions/#httpexception) exceptions should be + The `failed_request_status_codes` option only controls whether [`HTTPException`](https://fastapi.tiangolo.com/reference/exceptions/?h=httpexception) exceptions should be reported to Sentry. Other unhandled exceptions, which do not have a `status_code` attribute, are always reported to Sentry. Examples of valid `failed_request_status_codes`: From 8e4e7ad3aac08c65dae931faed47ccd14db7f22f Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Thu, 24 Oct 2024 12:09:00 +0200 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Liza Mock --- docs/platforms/python/integrations/fastapi/index.mdx | 4 ++-- docs/platforms/python/integrations/starlette/index.mdx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/platforms/python/integrations/fastapi/index.mdx b/docs/platforms/python/integrations/fastapi/index.mdx index d5f93b621537a..1f466ecb111d8 100644 --- a/docs/platforms/python/integrations/fastapi/index.mdx +++ b/docs/platforms/python/integrations/fastapi/index.mdx @@ -134,8 +134,8 @@ You can pass the following keyword arguments to `StarletteIntegration()` and `Fa A `set` of integers that will determine which status codes should be reported to Sentry. - The `failed_request_status_codes` option only controls whether [`HTTPException`](https://fastapi.tiangolo.com/reference/exceptions/?h=httpexception) exceptions should be - reported to Sentry. Other unhandled exceptions, which do not have a `status_code` attribute, are always reported to Sentry. + The `failed_request_status_codes` option determines whether [`HTTPException`](https://fastapi.tiangolo.com/reference/exceptions/?h=httpexception) exceptions should be + reported to Sentry. Unhandled exceptions that don't have a `status_code` attribute will always be reported to Sentry. Examples of valid `failed_request_status_codes`: diff --git a/docs/platforms/python/integrations/starlette/index.mdx b/docs/platforms/python/integrations/starlette/index.mdx index 2337d894438c3..396de6001989a 100644 --- a/docs/platforms/python/integrations/starlette/index.mdx +++ b/docs/platforms/python/integrations/starlette/index.mdx @@ -91,8 +91,8 @@ You can pass the following keyword arguments to `StarletteIntegration()`: A `set` of integers that will determine which status codes should be reported to Sentry. - The `failed_request_status_codes` option only controls whether [`HTTPException`](https://www.starlette.io/exceptions/#httpexception) exceptions should be - reported to Sentry. Other unhandled exceptions, which do not have a `status_code` attribute, are always reported to Sentry. + The `failed_request_status_codes` option determines whether [`HTTPException`](https://www.starlette.io/exceptions/#httpexception) exceptions should be + reported to Sentry. Unhandled exceptions that don't have a `status_code` attribute will always be reported to Sentry. Examples of valid `failed_request_status_codes`: