From 1afeabe6ff5114efbfd4e3fbaa07a3e9f5b29f9a Mon Sep 17 00:00:00 2001 From: Cody De Arkland Date: Tue, 18 Nov 2025 21:13:59 -0800 Subject: [PATCH 1/3] feat(python): Standardize Python docs navigation structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Standardizes Python SDK documentation navigation to match JavaScript structure: **Sidebar Sections** - Added 'Features' section with organized feature pages - Added 'Configuration' section (renamed to 'Extended Configuration') - Both sections now have proper headers and grouping **Features Section** (sidebar_section: features) Order: Capturing Errors → Logs → Tracing → Metrics → Profiling → Crons → User Feedback - Renamed 'Usage' to 'Capturing Errors' (matching JS) - Added 'new' tag to Logs - Added 'beta' tag to Metrics - Reordered all features for consistency **Configuration Section** (sidebar_section: configuration) Order: Sampling → Enriching Events → Extended Configuration → Integrations → Data Management → Security Policy Reporting → Migration → Troubleshooting - Moved sampling.mdx from configuration/ to root (matching JS) - Renamed Configuration index to 'Extended Configuration' - Applied sidebar_section to all configuration files - Applied sidebar_section to all related pages **File Changes** - 20 Python documentation files modified - 1 file moved (sampling.mdx) - 1 redirect added in redirects.js Follows the pattern established in feat/js-docs-apis-sampling-restructure branch. --- docs/platforms/python/configuration/index.mdx | 8 +++++--- docs/platforms/python/crons/index.mdx | 3 ++- .../platforms/python/data-management/index.mdx | 3 ++- .../python/enriching-events/index.mdx | 3 ++- docs/platforms/python/feature-flags/index.mdx | 1 + docs/platforms/python/index.mdx | 18 ++++++------------ .../python/integrations/django/index.mdx | 14 +++++++++----- .../python/integrations/fastapi/index.mdx | 11 +++++++++++ .../python/integrations/flask/index.mdx | 11 +++++++++++ docs/platforms/python/integrations/index.mdx | 3 ++- docs/platforms/python/logs/index.mdx | 4 +++- docs/platforms/python/metrics/index.mdx | 4 +++- docs/platforms/python/migration/index.mdx | 3 ++- docs/platforms/python/profiling/index.mdx | 3 ++- .../python/{configuration => }/sampling.mdx | 3 ++- .../python/security-policy-reporting/index.mdx | 3 ++- docs/platforms/python/tracing/index.mdx | 3 ++- docs/platforms/python/troubleshooting.mdx | 3 ++- docs/platforms/python/usage/index.mdx | 11 ++++++----- docs/platforms/python/user-feedback/index.mdx | 3 ++- redirects.js | 4 ++++ 21 files changed, 81 insertions(+), 38 deletions(-) rename docs/platforms/python/{configuration => }/sampling.mdx (99%) diff --git a/docs/platforms/python/configuration/index.mdx b/docs/platforms/python/configuration/index.mdx index cff67a5bf5f5c..88b37649c956a 100644 --- a/docs/platforms/python/configuration/index.mdx +++ b/docs/platforms/python/configuration/index.mdx @@ -1,7 +1,9 @@ --- -title: Configuration -description: "Additional configuration options for the SDK." -sidebar_order: 5 +title: Extended Configuration +sidebar_title: Extended Configuration +description: "Learn about additional configuration options for the Python SDK." +sidebar_order: 13 +sidebar_section: configuration --- diff --git a/docs/platforms/python/crons/index.mdx b/docs/platforms/python/crons/index.mdx index 0b08bb3b3ad3e..136097bea9361 100644 --- a/docs/platforms/python/crons/index.mdx +++ b/docs/platforms/python/crons/index.mdx @@ -2,7 +2,8 @@ title: Set Up Crons sidebar_title: Crons description: "Sentry Crons allows you to monitor the uptime and performance of any scheduled, recurring job in your application." -sidebar_order: 5750 +sidebar_order: 9 +sidebar_section: features --- Once implemented, it'll allow you to get alerts and metrics to help you solve errors, detect timeouts, and prevent disruptions to your service. diff --git a/docs/platforms/python/data-management/index.mdx b/docs/platforms/python/data-management/index.mdx index a55334f82643b..0fa7c42fa5515 100644 --- a/docs/platforms/python/data-management/index.mdx +++ b/docs/platforms/python/data-management/index.mdx @@ -1,7 +1,8 @@ --- title: Data Management description: Manage your events by pre-filtering, scrubbing sensitive information, and forwarding them to other systems. -sidebar_order: 2500 +sidebar_order: 15 +sidebar_section: configuration --- diff --git a/docs/platforms/python/enriching-events/index.mdx b/docs/platforms/python/enriching-events/index.mdx index b7f2c5a94bfdb..5ba1e02e0d731 100644 --- a/docs/platforms/python/enriching-events/index.mdx +++ b/docs/platforms/python/enriching-events/index.mdx @@ -1,7 +1,8 @@ --- title: Enriching Events description: Enrich events with additional context to make debugging simpler. -sidebar_order: 2300 +sidebar_order: 12 +sidebar_section: configuration --- diff --git a/docs/platforms/python/feature-flags/index.mdx b/docs/platforms/python/feature-flags/index.mdx index 1df20c20648e7..3d6810b474157 100644 --- a/docs/platforms/python/feature-flags/index.mdx +++ b/docs/platforms/python/feature-flags/index.mdx @@ -2,6 +2,7 @@ title: Set Up Feature Flags sidebar_title: Feature Flags sidebar_order: 7000 +sidebar_section: features description: With Feature Flags, Sentry tracks feature flag evaluations in your application, keeps an audit log of feature flag changes, and reports any suspicious updates that may have caused an error. --- diff --git a/docs/platforms/python/index.mdx b/docs/platforms/python/index.mdx index 2284a3415fa8c..aca9f92b4c3a9 100644 --- a/docs/platforms/python/index.mdx +++ b/docs/platforms/python/index.mdx @@ -15,18 +15,6 @@ categories: - You need a Sentry [account](https://sentry.io/signup/) and [project](/product/projects/) - Read one of our dedicated guides if you use any of the frameworks we support -## Features - -

- Select which Sentry features you'd like to install in addition to Error - Monitoring to get the corresponding installation and configuration - instructions below. -

- - - ## Install Install the Sentry SDK using [`pip`](https://pip.pypa.io/en/stable/): @@ -41,6 +29,12 @@ uv add "sentry-sdk" ## Configure +Choose the features you want to configure, and this guide will show you how: + + + Configuration should happen as **early as possible** in your application's lifecycle. ```python diff --git a/docs/platforms/python/integrations/django/index.mdx b/docs/platforms/python/integrations/django/index.mdx index 949f509af9603..817e59d67f63c 100644 --- a/docs/platforms/python/integrations/django/index.mdx +++ b/docs/platforms/python/integrations/django/index.mdx @@ -26,20 +26,19 @@ uv add "sentry-sdk[django]" ## Configure -To configure the Sentry SDK, initialize it in your `settings.py` file: - -In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](/concepts/key-terms/tracing/). You can also collect and analyze performance profiles from real users with [profiling](/product/explore/profiling/). - -Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below. +Choose the features you want to configure, and this guide will show you how: +To configure the Sentry SDK, initialize it in your `settings.py` file: + ```python {filename:settings.py} import sentry_sdk @@ -61,6 +60,11 @@ sentry_sdk.init( # there is an active span. profile_lifecycle="trace", # ___PRODUCT_OPTION_END___ profiling + # ___PRODUCT_OPTION_START___ logs + + # Enable logs to be sent to Sentry + enable_logs=True, + # ___PRODUCT_OPTION_END___ logs ) ``` diff --git a/docs/platforms/python/integrations/fastapi/index.mdx b/docs/platforms/python/integrations/fastapi/index.mdx index a4d2a57ce15ee..054b559f674a1 100644 --- a/docs/platforms/python/integrations/fastapi/index.mdx +++ b/docs/platforms/python/integrations/fastapi/index.mdx @@ -19,6 +19,17 @@ uv add "sentry-sdk[fastapi]" ## Configure +Choose the features you want to configure, and this guide will show you how: + + + If you have the `fastapi` package in your dependencies, the FastAPI integration will be enabled automatically when you initialize the Sentry SDK. diff --git a/docs/platforms/python/integrations/flask/index.mdx b/docs/platforms/python/integrations/flask/index.mdx index 7274043329655..6fc81b29fac40 100644 --- a/docs/platforms/python/integrations/flask/index.mdx +++ b/docs/platforms/python/integrations/flask/index.mdx @@ -18,6 +18,17 @@ uv add "sentry-sdk[flask]" ## Configure +Choose the features you want to configure, and this guide will show you how: + + + If you have the `flask` package in your dependencies, the Flask integration will be enabled automatically when you initialize the Sentry SDK. diff --git a/docs/platforms/python/integrations/index.mdx b/docs/platforms/python/integrations/index.mdx index c3856977405c4..797b6e1218e7b 100644 --- a/docs/platforms/python/integrations/index.mdx +++ b/docs/platforms/python/integrations/index.mdx @@ -1,7 +1,8 @@ --- title: Integrations description: "Sentry provides additional integrations designed to change configuration or add instrumentation to your application." -sidebar_order: 40 +sidebar_order: 14 +sidebar_section: configuration --- The Sentry SDK uses integrations to hook into the functionality of popular libraries to automatically instrument your application and give you the best data out of the box. diff --git a/docs/platforms/python/logs/index.mdx b/docs/platforms/python/logs/index.mdx index 760c7672c85be..8726e669e654a 100644 --- a/docs/platforms/python/logs/index.mdx +++ b/docs/platforms/python/logs/index.mdx @@ -2,7 +2,9 @@ title: Set Up Logs sidebar_title: Logs description: "Structured logs allow you to send, view and query logs sent from your applications within Sentry." -sidebar_order: 5755 +sidebar_order: 4 +sidebar_section: features +new: true --- With Sentry Structured Logs, you can send text-based log information from your applications to Sentry. Once in Sentry, these logs can be viewed alongside relevant errors, searched by text-string, or searched using their individual attributes. diff --git a/docs/platforms/python/metrics/index.mdx b/docs/platforms/python/metrics/index.mdx index dee9d349e62a2..9b4adb8442978 100644 --- a/docs/platforms/python/metrics/index.mdx +++ b/docs/platforms/python/metrics/index.mdx @@ -2,7 +2,9 @@ title: Set Up Metrics sidebar_title: Metrics description: "Metrics allow you to send, view and query counters, gauges and measurements sent from your applications within Sentry." -sidebar_order: 5755 +sidebar_order: 7 +sidebar_section: features +beta: true --- diff --git a/docs/platforms/python/migration/index.mdx b/docs/platforms/python/migration/index.mdx index 952faa78b198a..a04ec4b32e20e 100644 --- a/docs/platforms/python/migration/index.mdx +++ b/docs/platforms/python/migration/index.mdx @@ -1,7 +1,8 @@ --- title: Migration Guide description: "Migrate from an older version of our Python SDK." -sidebar_order: 8000 +sidebar_order: 17 +sidebar_section: configuration --- Here's a list of guides on migrating to a newer version of the Python SDK. diff --git a/docs/platforms/python/profiling/index.mdx b/docs/platforms/python/profiling/index.mdx index 0157172228c6a..06c0fb4594fd8 100644 --- a/docs/platforms/python/profiling/index.mdx +++ b/docs/platforms/python/profiling/index.mdx @@ -2,7 +2,8 @@ title: Set Up Python Profiling sidebar_title: Profiling description: "Learn how to enable profiling in your app if it is not already set up." -sidebar_order: 5000 +sidebar_order: 8 +sidebar_section: features --- diff --git a/docs/platforms/python/configuration/sampling.mdx b/docs/platforms/python/sampling.mdx similarity index 99% rename from docs/platforms/python/configuration/sampling.mdx rename to docs/platforms/python/sampling.mdx index 7c2b691b3f5c7..6bbece4c0d7d9 100644 --- a/docs/platforms/python/configuration/sampling.mdx +++ b/docs/platforms/python/sampling.mdx @@ -1,7 +1,8 @@ --- title: Sampling description: "Learn how to configure the volume of error and transaction events sent to Sentry." -sidebar_order: 60 +sidebar_section: configuration +sidebar_order: 11 --- Adding Sentry to your app gives you a great deal of very valuable information about errors and performance you wouldn't otherwise get. And lots of information is good -- as long as it's the right information, at a reasonable volume. diff --git a/docs/platforms/python/security-policy-reporting/index.mdx b/docs/platforms/python/security-policy-reporting/index.mdx index 862fcb12452c4..f8b9b32f06ded 100644 --- a/docs/platforms/python/security-policy-reporting/index.mdx +++ b/docs/platforms/python/security-policy-reporting/index.mdx @@ -1,8 +1,9 @@ --- title: Set Up Security Policy Reporting sidebar_title: Security Policy Reporting -sidebar_order: 7500 +sidebar_order: 16 description: "Learn how Sentry can help manage Content-Security-Policy violations and reports here." +sidebar_section: configuration --- diff --git a/docs/platforms/python/tracing/index.mdx b/docs/platforms/python/tracing/index.mdx index 3b6d7b70b306e..acd9cf828c4f4 100644 --- a/docs/platforms/python/tracing/index.mdx +++ b/docs/platforms/python/tracing/index.mdx @@ -2,7 +2,8 @@ title: Set Up Tracing sidebar_title: Tracing description: "With Tracing, Sentry tracks your software performance, measuring metrics like throughput and latency, and displays the impact of errors across multiple systems." -sidebar_order: 4000 +sidebar_order: 6 +sidebar_section: features --- ## Prerequisites diff --git a/docs/platforms/python/troubleshooting.mdx b/docs/platforms/python/troubleshooting.mdx index 76cb2200ab173..f0ff2fb88f678 100644 --- a/docs/platforms/python/troubleshooting.mdx +++ b/docs/platforms/python/troubleshooting.mdx @@ -1,7 +1,8 @@ --- title: Troubleshooting description: "While we don't expect most users of our SDK to run into these issues, we document edge cases here." -sidebar_order: 9000 +sidebar_order: 18 +sidebar_section: configuration --- ## General diff --git a/docs/platforms/python/usage/index.mdx b/docs/platforms/python/usage/index.mdx index d6f8b4e674d6f..dc686940799ab 100644 --- a/docs/platforms/python/usage/index.mdx +++ b/docs/platforms/python/usage/index.mdx @@ -1,7 +1,8 @@ --- -title: Usage -sidebar_order: 10 -description: "Use the SDK to manually capture errors and other events." +title: Capturing Errors +description: "Learn how to use the SDK to manually capture errors and other events." +sidebar_order: 2 +sidebar_section: features --- Sentry's SDK hooks into your runtime environment and automatically reports errors, uncaught exceptions, and unhandled rejections as well as other types of errors depending on the platform. @@ -13,11 +14,11 @@ Key terms: - An _event_ is one instance of sending data to Sentry. Generally, this data is an error or exception. - An _issue_ is a grouping of similar events. - The reporting of an event is called _capturing_. - When an event is captured, it’s sent to Sentry. + When an event is captured, it's sent to Sentry. -Python exceptions are captured in Sentry. You can omit the argument to and Sentry will attempt to capture the current exception. It is also useful for manual reporting of exceptions or messages to Sentry. +The most common form of capturing is to capture errors. What can be captured as an error varies by platform. In general, if you have something that looks like an exception, it can be captured. For some SDKs, you can also omit the argument to and Sentry will attempt to capture the current exception. It is also useful for manual reporting of errors or messages to Sentry. While capturing an event, you can also record the breadcrumbs that lead up to that event. Breadcrumbs are different from events: they will not create an event in Sentry, but will be buffered until the next event is sent. Learn more about breadcrumbs in our Breadcrumbs documentation. diff --git a/docs/platforms/python/user-feedback/index.mdx b/docs/platforms/python/user-feedback/index.mdx index cfcb8c44f6377..36fdde636e902 100644 --- a/docs/platforms/python/user-feedback/index.mdx +++ b/docs/platforms/python/user-feedback/index.mdx @@ -2,7 +2,8 @@ title: Set Up User Feedback sidebar_title: User Feedback description: "Learn more about collecting user feedback when an event occurs. Sentry pairs the feedback with the original event, giving you additional insight into issues." -sidebar_order: 6000 +sidebar_order: 10 +sidebar_section: features --- When a user experiences an error, Sentry provides the ability to collect additional feedback. You can collect feedback according to the method supported by the SDK. diff --git a/redirects.js b/redirects.js index c9d95e88ae87a..5392947a10b2a 100644 --- a/redirects.js +++ b/redirects.js @@ -609,6 +609,10 @@ const userDocsRedirects = [ source: '/platforms/python/guides/:guide/:path*', destination: '/platforms/python/:path*', }, + { + source: '/platforms/python/configuration/sampling/', + destination: '/platforms/python/sampling/', + }, { source: '/platforms/php/guides/laravel/other-versions/laravel8-10/usage/:path*', destination: '/platforms/php/guides/laravel/usage/:path*', From 350b787a00157ecc424bbb56b8fb0aa8a6b48628 Mon Sep 17 00:00:00 2001 From: Cody De Arkland Date: Wed, 19 Nov 2025 12:58:13 -0800 Subject: [PATCH 2/3] Better semantics on ordering --- docs/platforms/python/feature-flags/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/python/feature-flags/index.mdx b/docs/platforms/python/feature-flags/index.mdx index 3d6810b474157..1024128731328 100644 --- a/docs/platforms/python/feature-flags/index.mdx +++ b/docs/platforms/python/feature-flags/index.mdx @@ -1,7 +1,7 @@ --- title: Set Up Feature Flags sidebar_title: Feature Flags -sidebar_order: 7000 +sidebar_order: 8 sidebar_section: features description: With Feature Flags, Sentry tracks feature flag evaluations in your application, keeps an audit log of feature flag changes, and reports any suspicious updates that may have caused an error. --- From 347cd3cb0dd33f778a698fe334c3fdd909106bb3 Mon Sep 17 00:00:00 2001 From: Cody De Arkland Date: Wed, 19 Nov 2025 16:06:04 -0800 Subject: [PATCH 3/3] Fixing sidenav order for feature flags doc --- docs/platforms/python/feature-flags/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/python/feature-flags/index.mdx b/docs/platforms/python/feature-flags/index.mdx index 1024128731328..34cbc53db95f3 100644 --- a/docs/platforms/python/feature-flags/index.mdx +++ b/docs/platforms/python/feature-flags/index.mdx @@ -1,7 +1,7 @@ --- title: Set Up Feature Flags sidebar_title: Feature Flags -sidebar_order: 8 +sidebar_order: 11 sidebar_section: features description: With Feature Flags, Sentry tracks feature flag evaluations in your application, keeps an audit log of feature flag changes, and reports any suspicious updates that may have caused an error. ---