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

Prepend every rqd log line with a timestamp #1286

Conversation

DiegoTavares
Copy link
Collaborator

Link the Issue(s) this Pull Request is related to.
Some tools don't have timestamp intergrated into their logging format, which makes it hard to identify what steps on a process might be slower than normal. The simpler solution is to change the logging format on these tools, but that's not always possible.

Summarize your change.
To overcome the challange mentioned above, a new feature was made available to automatically prepend a timestamp to every rqlog line. This feature can be turned on/off using the constant RQD_PREPEND_TIMESTAMP.

Not all applications launched on rqd have logs with a timestamp, which makes is difficult to debug jobs that are taking more than expected on the cue. This feature prepends a timestamp for every line.
@DiegoTavares
Copy link
Collaborator Author

There are some pipeline failures on things that were not touched by this PR

Copy link
Collaborator

@bcipriano bcipriano left a comment

Choose a reason for hiding this comment

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

Change LGTM. Let's merge from master and see if those test failures persist. Probably not due to this PR but it'll give me some fresh logs to look into to resolve separately.

@@ -567,6 +567,7 @@ def setUp(self):

@mock.patch('platform.system', new=mock.Mock(return_value='Linux'))
@mock.patch('tempfile.gettempdir')
@mock.patch('rqd.rqcore.pipe_to_file', new=mock.MagicMock())
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we have to mock this, it means we're testing the pipe_to_file codepath instead of the default one, right?

Can we set RQD_PREPEND_TIMESTAMP = False in this test so we're testing the default codepath instead?

@DiegoTavares DiegoTavares merged commit 48abfd8 into AcademySoftwareFoundation:master Jun 7, 2023
12 of 14 checks passed
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.

None yet

2 participants