Skip to content

Commit eb94516

Browse files
committed
fix(aci): Improve legacy model tracking
1 parent 8156cbe commit eb94516

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/sentry/incidents/endpoints/bases.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from sentry.workflow_engine.endpoints.utils.ids import to_valid_int_id
1515
from sentry.workflow_engine.models.alertrule_detector import AlertRuleDetector
1616
from sentry.workflow_engine.models.detector import Detector
17+
from sentry.workflow_engine.utils.legacy_metric_tracking import report_used_legacy_models
1718

1819

1920
class OrganizationAlertRuleBaseEndpoint(OrganizationEndpoint):
@@ -150,6 +151,7 @@ def convert_args(
150151

151152
return args, kwargs
152153

154+
report_used_legacy_models()
153155
try:
154156
kwargs["alert_rule"] = AlertRule.objects.get(
155157
projects=project, id=validated_alert_rule_id
@@ -203,6 +205,7 @@ def convert_args(
203205

204206
return args, kwargs
205207

208+
report_used_legacy_models()
206209
try:
207210
kwargs["alert_rule"] = AlertRule.objects.get(
208211
organization=organization, id=validated_alert_rule_id

src/sentry/rules/history/endpoints/project_rule_group_history.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from sentry.rules.history import fetch_rule_groups_paginated
2424
from sentry.rules.history.base import RuleGroupHistory
2525
from sentry.workflow_engine.models.workflow import Workflow
26+
from sentry.workflow_engine.utils.legacy_metric_tracking import track_alert_endpoint_execution
2627

2728

2829
class RuleGroupHistoryResponse(TypedDict):
@@ -78,6 +79,7 @@ class ProjectRuleGroupHistoryIndexEndpoint(WorkflowEngineRuleEndpoint):
7879
404: RESPONSE_NOT_FOUND,
7980
},
8081
)
82+
@track_alert_endpoint_execution("GET", "sentry-api-0-project-rule-group-history-index")
8183
def get(self, request: Request, project: Project, rule: Rule | Workflow) -> Response:
8284
per_page = self.get_per_page(request)
8385
cursor = self.get_cursor_from_request(request)

src/sentry/rules/history/endpoints/project_rule_stats.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from sentry.rules.history import fetch_rule_hourly_stats
2121
from sentry.rules.history.base import TimeSeriesValue
2222
from sentry.workflow_engine.models.workflow import Workflow
23+
from sentry.workflow_engine.utils.legacy_metric_tracking import track_alert_endpoint_execution
2324

2425

2526
class TimeSeriesValueResponse(TypedDict):
@@ -61,6 +62,7 @@ class ProjectRuleStatsIndexEndpoint(WorkflowEngineRuleEndpoint):
6162
404: RESPONSE_NOT_FOUND,
6263
},
6364
)
65+
@track_alert_endpoint_execution("GET", "sentry-api-0-project-rule-stats-index")
6466
def get(self, request: Request, project: Project, rule: Rule | Workflow) -> Response:
6567
"""
6668
Note that results are returned in hourly buckets.

0 commit comments

Comments
 (0)