Skip to content

feat(python): Add new config option #9332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/platforms/python/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,23 @@ Controls how many seconds to wait before shutting down. Sentry SDKs send events

</ConfigKey>

<ConfigKey name="socket-options">

An optional list of socket options to use. If provided, these will override the default `urllib3` [socket options](https://urllib3.readthedocs.io/en/stable/reference/urllib3.connection.html#urllib3.connection.HTTPConnection). This is useful for enabling TCP keepalive in environments where you encounter frequent connection resets:

```python
import socket
from urllib3.connection import HTTPConnection

sentry_sdk.init(
socket_options=HTTPConnection.default_socket_options + [
(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),
],
)
```

</ConfigKey>

## Tracing Options

<ConfigKey name="enable-tracing">
Expand Down