Skip to content

Commit 8d4f71c

Browse files
authored
chore(perf-issues): Add a flag and check it to allow customer to disable detectors (#91734)
This will be overridden by detector work later on, but expose it now so customers can understand how it might work (and disable any detectors without support tickets)
1 parent cae0538 commit 8d4f71c

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/sentry/api/endpoints/project_performance_issue_settings.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,15 @@ def put(self, request: Request, project) -> Response:
222222
)
223223

224224
body_has_admin_options = any([option in request.data for option in internal_only_settings])
225-
if body_has_admin_options and not superuser_has_permission(request):
225+
if (
226+
body_has_admin_options
227+
and not superuser_has_permission(request)
228+
and not features.has(
229+
"organizations:performance-manage-detectors",
230+
project.organization,
231+
actor=request.user,
232+
)
233+
):
226234
return Response(
227235
{
228236
"detail": {

src/sentry/features/temporary.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,14 @@ def register_temporary_features(manager: FeatureManager):
198198
manager.add("organizations:ownership-size-limit-large", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
199199
# Enable xlarge ownership rule file size limit
200200
manager.add("organizations:ownership-size-limit-xlarge", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
201+
# Enable project admins to enable/disable performance detectors
202+
manager.add("organizations:performance-manage-detectors", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
201203
# Enable mobile performance score calculation for transactions in relay
202204
manager.add("organizations:performance-calculate-mobile-perf-score-relay", OrganizationFeature, FeatureHandlerStrategy.INTERNAL, api_expose=False)
203205
# Enable performance change explorer panel on trends page
204206
manager.add("organizations:performance-change-explorer", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
205207
# Enable interpolation of null data points in charts instead of zerofilling in performance
206208
manager.add("organizations:performance-chart-interpolation", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
207-
# Enable consecutive http performance issue type
208-
manager.add("organizations:performance-consecutive-http-detector", OrganizationFeature, FeatureHandlerStrategy.INTERNAL, api_expose=False)
209209
# Enable Discover Saved Query dataset selector
210210
manager.add("organizations:performance-discover-dataset-selector", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
211211
# Enable deprecate discover widget type
@@ -222,8 +222,6 @@ def register_temporary_features(manager: FeatureManager):
222222
manager.add("organizations:performance-issues-search", OrganizationFeature, FeatureHandlerStrategy.INTERNAL, default=True, api_expose=False)
223223
# Detect performance issues in the new standalone spans pipeline instead of on transactions
224224
manager.add("organizations:performance-issues-spans", OrganizationFeature, FeatureHandlerStrategy.INTERNAL, default=False, api_expose=False)
225-
# Enable consecutive http performance issue type
226-
manager.add("organizations:performance-large-http-payload-detector", OrganizationFeature, FeatureHandlerStrategy.INTERNAL, api_expose=False)
227225
# Enable internal view for bannerless MEP view
228226
manager.add("organizations:performance-mep-bannerless-ui", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
229227
# Re-enable histograms for Metrics Enhanced Performance Views

0 commit comments

Comments
 (0)