Skip to content

Commit a881dc5

Browse files
chore: Deprecate description truncation option for Redis spans
1 parent faa327c commit a881dc5

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

sentry_sdk/integrations/redis/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import warnings
2+
13
from sentry_sdk.integrations import Integration, DidNotEnable
24
from sentry_sdk.integrations.redis.consts import _DEFAULT_MAX_DATA_SIZE
35
from sentry_sdk.integrations.redis.rb import _patch_rb
@@ -16,10 +18,18 @@ class RedisIntegration(Integration):
1618
identifier = "redis"
1719

1820
def __init__(self, max_data_size=_DEFAULT_MAX_DATA_SIZE, cache_prefixes=None):
19-
# type: (int, Optional[list[str]]) -> None
21+
# type: (Optional[int], Optional[list[str]]) -> None
2022
self.max_data_size = max_data_size
2123
self.cache_prefixes = cache_prefixes if cache_prefixes is not None else []
2224

25+
if max_data_size is not None:
26+
warnings.warn(
27+
"The `max_data_size` parameter of the `RedisIntegration() constructor is"
28+
"deprecated and will be removed in version 3.0 of sentry-sdk.",
29+
DeprecationWarning,
30+
stacklevel=2,
31+
)
32+
2333
@staticmethod
2434
def setup_once():
2535
# type: () -> None

sentry_sdk/integrations/redis/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
]
1717
_MAX_NUM_ARGS = 10 # Trim argument lists to this many values
1818
_MAX_NUM_COMMANDS = 10 # Trim command lists to this many values
19-
_DEFAULT_MAX_DATA_SIZE = 1024
19+
_DEFAULT_MAX_DATA_SIZE = None

0 commit comments

Comments
 (0)