From 5220cf5cce9386672d8085d3cb2ea8639452a7c2 Mon Sep 17 00:00:00 2001 From: Mihir Mavalankar Date: Thu, 14 Aug 2025 16:05:48 -0700 Subject: [PATCH 1/6] feat(summarization): Route s4s traffic to new pod --- src/sentry/seer/autofix/issue_summary.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sentry/seer/autofix/issue_summary.py b/src/sentry/seer/autofix/issue_summary.py index 2af06315a33a27..fcf5d165fbd780 100644 --- a/src/sentry/seer/autofix/issue_summary.py +++ b/src/sentry/seer/autofix/issue_summary.py @@ -161,8 +161,13 @@ def _call_seer( option=orjson.OPT_NON_STR_KEYS, ) + url = settings.SEER_AUTOFIX_URL + # Use the summarization URL in S4S environments + if getattr(settings, "CUSTOMER_ID", None) == "sentry4sentry": + url = settings.SEER_SUMMARIZATION_URL + response = requests.post( - f"{settings.SEER_AUTOFIX_URL}{path}", + f"{url}{path}", data=body, headers={ "content-type": "application/json;charset=utf-8", From 04cd68d6f12b574cdca81de2e90871e3c20895db Mon Sep 17 00:00:00 2001 From: Mihir Mavalankar Date: Fri, 15 Aug 2025 09:28:43 -0700 Subject: [PATCH 2/6] using options instead of if else --- src/sentry/options/defaults.py | 8 ++++++++ src/sentry/seer/autofix/issue_summary.py | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/sentry/options/defaults.py b/src/sentry/options/defaults.py index dbe24a59a0e7a1..e9e6b996850598 100644 --- a/src/sentry/options/defaults.py +++ b/src/sentry/options/defaults.py @@ -1047,6 +1047,14 @@ type=Bool, flags=FLAG_MODIFIABLE_BOOL | FLAG_AUTOMATOR_MODIFIABLE, ) + +# Route issue summary requests to the summarization URL instead of the autofix URL +register( + "seer.issue-summary.use-summarization-url", + default=False, + type=Bool, + flags=FLAG_MODIFIABLE_BOOL | FLAG_AUTOMATOR_MODIFIABLE, +) register( "seer.anomaly-detection-killswitch.enabled", default=False, diff --git a/src/sentry/seer/autofix/issue_summary.py b/src/sentry/seer/autofix/issue_summary.py index fcf5d165fbd780..e781350e4c4efe 100644 --- a/src/sentry/seer/autofix/issue_summary.py +++ b/src/sentry/seer/autofix/issue_summary.py @@ -10,7 +10,7 @@ from django.conf import settings from django.contrib.auth.models import AnonymousUser -from sentry import eventstore, features, quotas +from sentry import eventstore, features, options, quotas from sentry.api.serializers import EventSerializer, serialize from sentry.api.serializers.rest_framework.base import convert_dict_key_case, snake_to_camel_case from sentry.constants import DataCategory, ObjectStatus @@ -162,8 +162,8 @@ def _call_seer( ) url = settings.SEER_AUTOFIX_URL - # Use the summarization URL in S4S environments - if getattr(settings, "CUSTOMER_ID", None) == "sentry4sentry": + # route to summarization URL if option is true + if options.get("seer.issue-summary.use-summarization-url"): url = settings.SEER_SUMMARIZATION_URL response = requests.post( From d443ef1532f145ba7f5ce523e0c7fb9ef2a701fa Mon Sep 17 00:00:00 2001 From: Mihir Mavalankar Date: Fri, 15 Aug 2025 09:38:49 -0700 Subject: [PATCH 3/6] using percentage rather than bool --- src/sentry/options/defaults.py | 8 ++++++++ src/sentry/seer/autofix/issue_summary.py | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/sentry/options/defaults.py b/src/sentry/options/defaults.py index e9e6b996850598..2c47fd51584ad4 100644 --- a/src/sentry/options/defaults.py +++ b/src/sentry/options/defaults.py @@ -949,6 +949,14 @@ flags=FLAG_AUTOMATOR_MODIFIABLE, ) +# Rollout rate to route issue summary requests to the summarization URL +register( + "issues.summary.summarization-url-rollout-rate", + type=Float, + default=0.0, + flags=FLAG_AUTOMATOR_MODIFIABLE, +) + register( "issues.priority.projects-allowlist", type=Sequence, diff --git a/src/sentry/seer/autofix/issue_summary.py b/src/sentry/seer/autofix/issue_summary.py index e781350e4c4efe..7f3f4f1a631e9a 100644 --- a/src/sentry/seer/autofix/issue_summary.py +++ b/src/sentry/seer/autofix/issue_summary.py @@ -10,7 +10,7 @@ from django.conf import settings from django.contrib.auth.models import AnonymousUser -from sentry import eventstore, features, options, quotas +from sentry import eventstore, features, quotas from sentry.api.serializers import EventSerializer, serialize from sentry.api.serializers.rest_framework.base import convert_dict_key_case, snake_to_camel_case from sentry.constants import DataCategory, ObjectStatus @@ -162,8 +162,8 @@ def _call_seer( ) url = settings.SEER_AUTOFIX_URL - # route to summarization URL if option is true - if options.get("seer.issue-summary.use-summarization-url"): + # Route to summarization URL based on rollout rate + if in_random_rollout("issues.summary.summarization-url-rollout-rate"): url = settings.SEER_SUMMARIZATION_URL response = requests.post( From a4e53394ac67f49cb46bcf33ef20a46ab30028f6 Mon Sep 17 00:00:00 2001 From: Mihir Mavalankar Date: Fri, 15 Aug 2025 09:42:59 -0700 Subject: [PATCH 4/6] removed unused option --- src/sentry/options/defaults.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/sentry/options/defaults.py b/src/sentry/options/defaults.py index 2c47fd51584ad4..e83ae19308ec5f 100644 --- a/src/sentry/options/defaults.py +++ b/src/sentry/options/defaults.py @@ -1057,12 +1057,6 @@ ) # Route issue summary requests to the summarization URL instead of the autofix URL -register( - "seer.issue-summary.use-summarization-url", - default=False, - type=Bool, - flags=FLAG_MODIFIABLE_BOOL | FLAG_AUTOMATOR_MODIFIABLE, -) register( "seer.anomaly-detection-killswitch.enabled", default=False, From 2c0cd7649a92e9fb13a83022c6bb2f298e1ce939 Mon Sep 17 00:00:00 2001 From: Mihir Mavalankar Date: Fri, 15 Aug 2025 09:43:33 -0700 Subject: [PATCH 5/6] removed unused option --- src/sentry/options/defaults.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/sentry/options/defaults.py b/src/sentry/options/defaults.py index e83ae19308ec5f..851a07402e904a 100644 --- a/src/sentry/options/defaults.py +++ b/src/sentry/options/defaults.py @@ -948,8 +948,6 @@ default=0.0, flags=FLAG_AUTOMATOR_MODIFIABLE, ) - -# Rollout rate to route issue summary requests to the summarization URL register( "issues.summary.summarization-url-rollout-rate", type=Float, From 3af8d56b2dfa999be09c2f7b09fec4949ae8b867 Mon Sep 17 00:00:00 2001 From: Mihir Mavalankar Date: Fri, 15 Aug 2025 09:44:36 -0700 Subject: [PATCH 6/6] removed unused option --- src/sentry/options/defaults.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sentry/options/defaults.py b/src/sentry/options/defaults.py index 851a07402e904a..33b692619429eb 100644 --- a/src/sentry/options/defaults.py +++ b/src/sentry/options/defaults.py @@ -948,6 +948,8 @@ default=0.0, flags=FLAG_AUTOMATOR_MODIFIABLE, ) + +# Rollout rate to route issue summary requests to the summarization URL register( "issues.summary.summarization-url-rollout-rate", type=Float, @@ -1053,8 +1055,6 @@ type=Bool, flags=FLAG_MODIFIABLE_BOOL | FLAG_AUTOMATOR_MODIFIABLE, ) - -# Route issue summary requests to the summarization URL instead of the autofix URL register( "seer.anomaly-detection-killswitch.enabled", default=False,