Skip to content

Commit

Permalink
[Monitoring] Make appengine crons emit metrics (#4572)
Browse files Browse the repository at this point in the history
Appengine crons are currently not instrumented, so we cannot get
testcase metrics for the google 3 deployment. This PR fixes that.

Part of #4271
  • Loading branch information
vitorguidi authored Jan 2, 2025
1 parent 0f5248e commit 13fb6f2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/appengine/libs/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from clusterfuzz._internal.config import local_config
from clusterfuzz._internal.datastore import data_types
from clusterfuzz._internal.google_cloud_utils import pubsub
from clusterfuzz._internal.metrics import monitor
from clusterfuzz._internal.system import environment
from libs import access
from libs import auth
Expand Down Expand Up @@ -96,11 +97,12 @@ def wrapper(self):
if not self.is_cron():
raise helpers.AccessDeniedError('You are not a cron.')

result = func(self)
if result is None:
return 'OK'
with monitor.wrap_with_monitoring():
result = func(self)
if result is None:
return 'OK'

return result
return result

return wrapper

Expand Down

0 comments on commit 13fb6f2

Please sign in to comment.