Browse Source

feat(self-hosted): Add errors only setting (#71785)

Hubert Deng 9 months ago
parent
commit
5fb584d4a1
3 changed files with 13 additions and 1 deletions
  1. 1 0
      src/sentry/conf/server.py
  2. 6 0
      src/sentry/utils/settings.py
  3. 6 1
      src/sentry/web/client_config.py

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

@@ -3059,6 +3059,7 @@ STATUS_PAGE_ID: str | None = None
 STATUS_PAGE_API_HOST = "statuspage.io"
 
 SENTRY_SELF_HOSTED = True
+SENTRY_SELF_HOSTED_ERRORS_ONLY = False
 # only referenced in getsentry to provide the stable beacon version
 # updated with scripts/bump-version.sh
 SELF_HOSTED_STABLE_VERSION = "24.5.0"

+ 6 - 0
src/sentry/utils/settings.py

@@ -11,3 +11,9 @@ def should_show_beacon_consent_prompt() -> bool:
     from sentry import options
 
     return settings.SENTRY_SELF_HOSTED and not options.isset("beacon.record_cpu_ram_usage")
+
+
+def is_self_hosted_errors_only() -> bool:
+    from django.conf import settings
+
+    return settings.SENTRY_SELF_HOSTED_ERRORS_ONLY and settings.SENTRY_SELF_HOSTED

+ 6 - 1
src/sentry/web/client_config.py

@@ -42,7 +42,11 @@ from sentry.utils import auth, json
 from sentry.utils.assets import get_frontend_dist_prefix
 from sentry.utils.email import is_smtp_enabled
 from sentry.utils.http import is_using_customer_domain
-from sentry.utils.settings import is_self_hosted, should_show_beacon_consent_prompt
+from sentry.utils.settings import (
+    is_self_hosted,
+    is_self_hosted_errors_only,
+    should_show_beacon_consent_prompt,
+)
 
 
 def _get_support_mail() -> str | None:
@@ -412,6 +416,7 @@ class _ClientConfig:
             # Maintain isOnPremise key for backcompat (plugins?).
             "isOnPremise": is_self_hosted(),
             "isSelfHosted": is_self_hosted(),
+            "isSelfHostedErrorsOnly": is_self_hosted_errors_only(),
             "shouldPreloadData": self.should_preload_data,
             "shouldShowBeaconConsentPrompt": not self.needs_upgrade
             and should_show_beacon_consent_prompt(),