From b3686af4ff115146ed5c3398ac210820d949ccc0 Mon Sep 17 00:00:00 2001 From: Lev Vereshchagin Date: Wed, 9 Oct 2024 13:21:59 +0300 Subject: [PATCH] Set larger default value of max_value_length for sentry-sdk --- README.md | 1 + microbootstrap/instruments/sentry_instrument.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 16c4211..88598e3 100644 --- a/README.md +++ b/README.md @@ -210,6 +210,7 @@ class YourSettings(BaseServiceSettings): sentry_traces_sample_rate: float | None = None sentry_sample_rate: float = pydantic.Field(default=1.0, le=1.0, ge=0.0) sentry_max_breadcrumbs: int = 15 + sentry_max_value_length: int = 16384 sentry_attach_stacktrace: bool = True sentry_integrations: list[Integration] = [] sentry_additional_params: dict[str, typing.Any] = {} diff --git a/microbootstrap/instruments/sentry_instrument.py b/microbootstrap/instruments/sentry_instrument.py index 26b1ead..964cc1e 100644 --- a/microbootstrap/instruments/sentry_instrument.py +++ b/microbootstrap/instruments/sentry_instrument.py @@ -15,6 +15,7 @@ class SentryConfig(BaseInstrumentConfig): sentry_traces_sample_rate: float | None = None sentry_sample_rate: float = pydantic.Field(default=1.0, le=1.0, ge=0.0) sentry_max_breadcrumbs: int = 15 + sentry_max_value_length: int = 16384 sentry_attach_stacktrace: bool = True sentry_integrations: list[Integration] = pydantic.Field(default_factory=list) sentry_additional_params: dict[str, typing.Any] = pydantic.Field(default_factory=dict) @@ -34,6 +35,7 @@ def bootstrap(self) -> None: traces_sample_rate=self.instrument_config.sentry_traces_sample_rate, environment=self.instrument_config.service_environment, max_breadcrumbs=self.instrument_config.sentry_max_breadcrumbs, + max_value_length=self.instrument_config.sentry_max_value_length, attach_stacktrace=self.instrument_config.sentry_attach_stacktrace, integrations=self.instrument_config.sentry_integrations, **self.instrument_config.sentry_additional_params,