Skip to content

Commit 13fb6f2

Browse files
authored
[Monitoring] Make appengine crons emit metrics (#4572)
Appengine crons are currently not instrumented, so we cannot get testcase metrics for the google 3 deployment. This PR fixes that. Part of #4271
1 parent 0f5248e commit 13fb6f2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/appengine/libs/handler.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from clusterfuzz._internal.config import local_config
3131
from clusterfuzz._internal.datastore import data_types
3232
from clusterfuzz._internal.google_cloud_utils import pubsub
33+
from clusterfuzz._internal.metrics import monitor
3334
from clusterfuzz._internal.system import environment
3435
from libs import access
3536
from libs import auth
@@ -96,11 +97,12 @@ def wrapper(self):
9697
if not self.is_cron():
9798
raise helpers.AccessDeniedError('You are not a cron.')
9899

99-
result = func(self)
100-
if result is None:
101-
return 'OK'
100+
with monitor.wrap_with_monitoring():
101+
result = func(self)
102+
if result is None:
103+
return 'OK'
102104

103-
return result
105+
return result
104106

105107
return wrapper
106108

0 commit comments

Comments
 (0)