Browse Source

feat(hybrid-cloud): Set frontend tags on Sentry events emitted whenever a customer domain is used (#40948)

Alberto Leal 2 years ago
parent
commit
2029ccd0a3
1 changed files with 9 additions and 0 deletions
  1. 9 0
      static/app/bootstrap/initializeSdk.tsx

+ 9 - 0
static/app/bootstrap/initializeSdk.tsx

@@ -111,6 +111,15 @@ export function initializeSdk(config: Config, {routes}: {routes?: Function} = {}
     Sentry.setTag('sentry_version', window.__SENTRY__VERSION);
   }
 
+  const {customerDomain} = window.__initialData;
+
+  if (customerDomain) {
+    Sentry.setTag('isCustomerDomain', 'yes');
+    Sentry.setTag('customerDomain.organizationUrl', customerDomain.organizationUrl);
+    Sentry.setTag('customerDomain.sentryUrl', customerDomain.sentryUrl);
+    Sentry.setTag('customerDomain.subdomain', customerDomain.subdomain);
+  }
+
   LongTaskObserver.startPerformanceObserver();
   initializeMeasureAssetsTimeout();
 }