Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Monitoring] Make appengine crons emit metrics #4572

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading