@@ -160,7 +160,23 @@ def detect_function_trends(project_ids: List[int], start: datetime, *args, **kwa
160
160
def detect_function_change_points (
161
161
functions_list : List [Tuple [int , int ]], start : datetime , * args , ** kwargs
162
162
) -> None :
163
- _detect_function_change_points (functions_list , start )
163
+ breakpoints = _detect_function_change_points (functions_list , start )
164
+
165
+ for entry in breakpoints :
166
+ with sentry_sdk .push_scope () as scope :
167
+ scope .set_tag ("regressed_project_id" , entry ["project" ])
168
+ # the service was originally meant for transactions so this
169
+ # naming is a result of this
170
+ scope .set_tag ("regressed_function_id" , entry ["transaction" ])
171
+ scope .set_context (
172
+ "statistical_detectors" ,
173
+ {
174
+ ** entry ,
175
+ "timestamp" : start .isoformat (),
176
+ "breakpoint" : datetime .fromtimestamp (entry ["breakpoint" ]),
177
+ },
178
+ )
179
+ sentry_sdk .capture_message ("Potential Regression" )
164
180
165
181
166
182
def _detect_function_trends (
@@ -259,21 +275,7 @@ def _detect_function_change_points(functions_list: List[Tuple[int, int]], start:
259
275
260
276
breakpoints = detect_breakpoints (request )["data" ]
261
277
262
- for entry in breakpoints :
263
- with sentry_sdk .push_scope () as scope :
264
- scope .set_tag ("regressed_project_id" , entry ["project" ])
265
- # the service was originally meant for transactions so this
266
- # naming is a result of this
267
- scope .set_tag ("regressed_function_id" , entry ["transaction" ])
268
- scope .set_context (
269
- "statistical_detectors" ,
270
- {
271
- ** entry ,
272
- "timestamp" : start .isoformat (),
273
- "breakpoint" : datetime .fromtimestamp (entry ["breakpoint" ]),
274
- },
275
- )
276
- sentry_sdk .capture_message ("Potential Regression" )
278
+ yield from breakpoints
277
279
278
280
279
281
def all_function_payloads (
0 commit comments