-
Notifications
You must be signed in to change notification settings - Fork 572
[Logging] Create and add structured logs for Cleanup task #4781
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
base: master
Are you sure you want to change the base?
Conversation
@@ -59,6 +60,11 @@ def main(): | |||
task = sys.argv[1] | |||
|
|||
task_module_name = f'clusterfuzz._internal.cron.{task}' | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make a standard function to do this rather than reimplementing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Adding structured logging to the cleanup cronjob. In order to enable this, the following changes on logs module were done:
extras
argument from python logging to thejson_fields
metadata in google cloud logging (GCP reference). (Note that this is a workaround to enable the observability project for now. As a long-term solution, we should try to centralize the logs handlers/filters for all environments).For the cleanup module:
Tests
Running the cronjob locally with the debugger and sending logs to GCP.
IS_K8S_ENV
to true (link to logs):