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

Add logging of clusterfuzz version #4472

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ParisMeuleman
Copy link
Contributor

No description provided.

@ParisMeuleman
Copy link
Contributor Author

#4200 will certainly be an issue for this too

src/clusterfuzz/_internal/metrics/logs.py Outdated Show resolved Hide resolved
src/clusterfuzz/_internal/metrics/logs.py Show resolved Hide resolved
src/clusterfuzz/_internal/metrics/logs.py Outdated Show resolved Hide resolved
@@ -151,6 +175,8 @@ def get_logging_config_dict(name):
get_handler_config('bot/logs/android_heartbeat.log', 1),
'run_cron':
get_handler_config('bot/logs/run_cron.log', 1),
'root':
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we adding this?

Copy link
Contributor Author

@ParisMeuleman ParisMeuleman Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the following error when running
python3 butler.py py_unittest -t core -v -p "*logs*"

======================================================================
ERROR: test_upload_to_logs_with_all_arguments (tests.core.metrics.fuzzer_logs_test.FuzzerLogsTest.test_upload_to_logs_with_all_arguments)
Test a call to upload_to_logs with all arguments being passed.
----
Traceback (most recent call last):
  File "/usr/local/google/home/pmeuleman/clusterfuzz/src/clusterfuzz/_internal/tests/core/metrics/fuzzer_logs_test.py", line 56, in test_upload_to_logs_with_all_arguments
    fuzzer_logs.upload_to_logs(
  File "/usr/local/google/home/pmeuleman/clusterfuzz/src/clusterfuzz/_internal/metrics/fuzzer_logs.py", line 147, in upload_to_logs
    logs.info('Uploaded file to logs bucket.', log_path=log_path)
  File "/usr/local/google/home/pmeuleman/clusterfuzz/src/clusterfuzz/_internal/metrics/logs.py", line 593, in info
    emit(logging.INFO, message, **extras)
  File "/usr/local/google/home/pmeuleman/clusterfuzz/src/clusterfuzz/_internal/metrics/logs.py", line 544, in emit
    logger = get_logger()
             ^^^^^^^^^^^^
  File "/usr/local/google/home/pmeuleman/clusterfuzz/src/clusterfuzz/_internal/metrics/logs.py", line 491, in get_logger
    configure('root')
  File "/usr/local/google/home/pmeuleman/clusterfuzz/src/clusterfuzz/_internal/metrics/logs.py", line 460, in configure
    config.dictConfig(get_logging_config_dict(name))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/google/home/pmeuleman/clusterfuzz/src/clusterfuzz/_internal/metrics/logs.py", line 185, in get_logging_config_dict
    'handler': logging_handler[name],
               ~~~~~~~~~~~~~~~^^^^^^
KeyError: 'root'

@jonathanmetzman
Copy link
Collaborator

I'm not entirely sure this is needed, given a log, you can always go back and find the version of CF that started the task.

@ParisMeuleman
Copy link
Contributor Author

I'm not entirely sure this is needed, given a log, you can always go back and find the version of CF that started the task.

You mean if you go back enough in the logs of a given task you'll find the version? I drafted this as a result of the outages the week before, I did not have a clear indication that the failure logs where from a given version, but that might just be that I did not know where to look. If we had this information we would probably have been able to pinpoint the release and take a corrective action much faster.

@jonathanmetzman
Copy link
Collaborator

I'm not entirely sure this is needed, given a log, you can always go back and find the version of CF that started the task.

You mean if you go back enough in the logs of a given task you'll find the version? I drafted this as a result of the outages the week before, I did not have a clear indication that the failure logs where from a given version, but that might just be that I did not know where to look. If we had this information we would probably have been able to pinpoint the release and take a corrective action much faster.

Exactly. Sorry this wasn't clear. I think I'm in favor of landing this, because it's better for something so important to be in an obvious place.

@ParisMeuleman ParisMeuleman marked this pull request as ready for review December 30, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants