Просмотр исходного кода

feat(sdk): Bump sentry-sdk to 1.28.0 (#52507)

Includes, among other things

* backpressure handling
* tracing without performance

we need to patch the `is_healthy` method because of the multiplex mess
Neel Shah 1 год назад
Родитель
Сommit
5659d03b83

+ 1 - 1
requirements-base.txt

@@ -62,7 +62,7 @@ sentry-arroyo>=2.14.0
 sentry-kafka-schemas>=0.1.16
 sentry-kafka-schemas>=0.1.16
 sentry-redis-tools>=0.1.7
 sentry-redis-tools>=0.1.7
 sentry-relay>=0.8.28
 sentry-relay>=0.8.28
-sentry-sdk>=1.23.0
+sentry-sdk>=1.28.0
 snuba-sdk>=1.0.5
 snuba-sdk>=1.0.5
 simplejson>=3.17.6
 simplejson>=3.17.6
 sqlparse>=0.4.4
 sqlparse>=0.4.4

+ 1 - 1
requirements-dev-frozen.txt

@@ -172,7 +172,7 @@ sentry-cli==2.16.0
 sentry-kafka-schemas==0.1.16
 sentry-kafka-schemas==0.1.16
 sentry-redis-tools==0.1.7
 sentry-redis-tools==0.1.7
 sentry-relay==0.8.28
 sentry-relay==0.8.28
-sentry-sdk==1.23.0
+sentry-sdk==1.28.0
 simplejson==3.17.6
 simplejson==3.17.6
 six==1.16.0
 six==1.16.0
 sniffio==1.2.0
 sniffio==1.2.0

+ 1 - 1
requirements-frozen.txt

@@ -119,7 +119,7 @@ sentry-arroyo==2.14.0
 sentry-kafka-schemas==0.1.16
 sentry-kafka-schemas==0.1.16
 sentry-redis-tools==0.1.7
 sentry-redis-tools==0.1.7
 sentry-relay==0.8.28
 sentry-relay==0.8.28
-sentry-sdk==1.23.0
+sentry-sdk==1.28.0
 simplejson==3.17.6
 simplejson==3.17.6
 six==1.16.0
 six==1.16.0
 sniffio==1.2.0
 sniffio==1.2.0

+ 1 - 0
src/sentry/conf/server.py

@@ -2713,6 +2713,7 @@ SENTRY_SDK_CONFIG = {
     "auto_enabling_integrations": False,
     "auto_enabling_integrations": False,
     "_experiments": {
     "_experiments": {
         "custom_measurements": True,
         "custom_measurements": True,
+        "enable_backpressure_handling": True,
     },
     },
 }
 }
 
 

+ 9 - 0
src/sentry/utils/sdk.py

@@ -421,6 +421,15 @@ def configure_sdk():
                         tags={"reason": "unsafe"},
                         tags={"reason": "unsafe"},
                     )
                     )
 
 
+        def is_healthy(self):
+            if sentry4sentry_transport:
+                if not sentry4sentry_transport.is_healthy():
+                    return False
+            if sentry_saas_transport:
+                if not sentry_saas_transport.is_healthy():
+                    return False
+            return True
+
     from sentry_sdk.integrations.celery import CeleryIntegration
     from sentry_sdk.integrations.celery import CeleryIntegration
     from sentry_sdk.integrations.django import DjangoIntegration
     from sentry_sdk.integrations.django import DjangoIntegration
     from sentry_sdk.integrations.logging import LoggingIntegration
     from sentry_sdk.integrations.logging import LoggingIntegration

+ 4 - 0
tests/sentry/utils/test_sdk.py

@@ -305,6 +305,10 @@ class CaptureExceptionWithScopeCheckTest(TestCase):
         empty_scope = Scope()
         empty_scope = Scope()
 
 
         for entry in empty_scope.__slots__:
         for entry in empty_scope.__slots__:
+            # _propagation_context is generated on __init__ for tracing without performance
+            # so is different every time.
+            if entry == "_propagation_context":
+                continue
             # No new scope data should be passed
             # No new scope data should be passed
             assert getattr(passed_scope, entry) == getattr(empty_scope, entry)
             assert getattr(passed_scope, entry) == getattr(empty_scope, entry)