Skip to content

Commit 876dd53

Browse files
ref(python): Version disambiguation for draining docs (#14068)
There is no `Hub` anymore, it was deprecated in 2.0. Direct link to preview: https://sentry-docs-git-ivana-pythonupdate-draining-page.sentry.dev/platforms/python/configuration/draining/ ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [x] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) --------- Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io>
1 parent 6fd6c61 commit 876dd53

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

docs/platforms/python/configuration/draining.mdx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,18 @@ description: "Learn more about the default behavior of our SDK if the applicatio
77
The default behavior of most SDKs is to send out events over the network
88
asynchronously in the background. This means that some events might be lost if the application shuts down unexpectedly. The SDKs provide mechanisms to cope with this.
99

10-
<PlatformContent includePath="configuration/drain-example" />
10+
The Python SDK automatically drains on shutdown unless the `AtexitIntegration` is removed or the `shutdown_timeout`
11+
config key is set to 0. If you need to manually drain, the client provides a `close` method:
12+
13+
```python
14+
import sentry_sdk
15+
16+
client = sentry_sdk.get_client()
17+
client.close(timeout=2.0)
18+
```
19+
20+
After a call to `close`, the client is disabled. It's important to
21+
only call `close` immediately before shutting down the application.
22+
23+
Alternatively, the `flush` method drains the event queue while keeping the
24+
client enabled for continued use.

platform-includes/configuration/drain-example/python.mdx renamed to docs/platforms/python/configuration/draining__v1.x.mdx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
The Python SDK automatically drains on shutdown unless the `AtExitIntegration` is removed or the `shutdown_timeout`
1+
---
2+
title: Shutdown and Draining
3+
sidebar_order: 80
4+
description: "Learn more about the default behavior of our SDK if the application shuts down unexpectedly."
5+
---
6+
7+
The default behavior of most SDKs is to send out events over the network
8+
asynchronously in the background. This means that some events might be lost if the application shuts down unexpectedly. The SDKs provide mechanisms to cope with this.
9+
10+
The Python SDK automatically drains on shutdown unless the `AtexitIntegration` is removed or the `shutdown_timeout`
211
config key is set to 0. To manually drain the client provides a `close` method:
312

413
```python

0 commit comments

Comments
 (0)