Browse Source

ref(spotlight): Remove all Spotlight related code (#79905)

Python SDK now has support for `SENTRY_SPOTLIGHT` env variable support
so removing anything we have added here specifically. Also removing the
'default on' behavior as it is creating more confusion than usefulness.
Burak Yigit Kaya 4 months ago
parent
commit
ae8cc693d0
3 changed files with 7 additions and 15 deletions
  1. 0 13
      src/sentry/conf/server.py
  2. 0 1
      src/sentry/utils/sdk.py
  3. 7 1
      static/app/bootstrap/initializeSdk.tsx

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

@@ -92,8 +92,6 @@ _env_cache: dict[str, object] = {}
 
 ENVIRONMENT = os.environ.get("SENTRY_ENVIRONMENT", "production")
 
-NO_SPOTLIGHT = os.environ.get("NO_SPOTLIGHT", False)
-
 IS_DEV = ENVIRONMENT == "development"
 
 DEBUG = IS_DEV
@@ -2230,9 +2228,6 @@ SENTRY_USE_ISSUE_OCCURRENCE = False
 # This flag activates consuming GroupAttribute messages in the development environment
 SENTRY_USE_GROUP_ATTRIBUTES = True
 
-# This flag activates Spotlight Sidecar in the development environment
-SENTRY_USE_SPOTLIGHT = False
-
 # This flag activates uptime checks in the developemnt environment
 SENTRY_USE_UPTIME = False
 
@@ -2479,14 +2474,6 @@ SENTRY_DEVSERVICES: dict[str, Callable[[Any, Any], dict[str, Any]]] = {
             "only_if": settings.SENTRY_USE_PROFILING,
         }
     ),
-    "spotlight-sidecar": lambda settings, options: (
-        {
-            "image": "ghcr.io/getsentry/spotlight:latest",
-            "environment": {},
-            "ports": {"8969/tcp": 8969},
-            "only_if": settings.SENTRY_USE_SPOTLIGHT,
-        }
-    ),
 }
 
 # Max file size for serialized file uploads in API

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

@@ -471,7 +471,6 @@ def configure_sdk():
             RedisIntegration(),
             ThreadingIntegration(propagate_hub=True),
         ],
-        spotlight=settings.IS_DEV and not settings.NO_SPOTLIGHT,
         **sdk_options,
     )
 

+ 7 - 1
static/app/bootstrap/initializeSdk.tsx

@@ -194,8 +194,14 @@ export function initializeSdk(config: Config) {
   });
 
   if (process.env.NODE_ENV !== 'production') {
-    if (sentryConfig.environment === 'development' && process.env.NO_SPOTLIGHT !== '1') {
+    if (
+      sentryConfig.environment === 'development' &&
+      process.env.SENTRY_SPOTLIGHT &&
+      !['false', 'f', 'n', 'no', 'off', '0'].includes(process.env.SENTRY_SPOTLIGHT)
+    ) {
       import('@spotlightjs/spotlight').then(Spotlight => {
+        // TODO: use the value of `process.env.SENTRY_SPOTLIGHT` for the `sidecarUrl` below when it is not "truthy"
+        //       Truthy is defined in https://github.com/getsentry/sentry-javascript/pull/13325/files#diff-a139d0f6c10ca33f2b0264da406662f90061cd7e8f707c197a02460a7f666e87R2
         /* #__PURE__ */ Spotlight.init();
       });
     }