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

Bucket Logging: BG worker to upload bucket logs #7816

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

aspandey
Copy link
Contributor

Bucket logs will be collected and placed on /log/noobaa_bucket_logs/ directory. The BG worker, BucketLogUploader, will keep scanning this directory and upload the object on a log bucket.
This log bucket name will be fetched from the log object name.

Testing Instructions:

Once the core pod is UP and running , exec into it and create /log/noobaa_bucket_logs/ directory.

Create some files with bucket name which we have created using nb command.
if you have created bucket like this -

nb api bucket_api create_bucket '{
"name": "log.bucket"
}'

Then create files as follows -

echo "Bucket logging " >> /log/noobaa_bucket_logs/log.bucket-1.log

After some time - config.BUCKET_LOG_UPLOADER_DELAY = 5 * 60 * 100; -
This log will be uploaded to log.bucket.

@aspandey
Copy link
Contributor Author

aspandey commented Feb 13, 2024

@dannyzaken , @romayalon, @liranmauda
This is a working PR. However, there are few things which we still need to decide and make changes, for example what should be the delay of scanning , naming convention of log files and all.
I would like your initial comments on this patch.

Copy link
Contributor

@liranmauda liranmauda left a comment

Choose a reason for hiding this comment

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

Few comment:

  1. When we use dbg, we don't need to specify the file name.
    for example: instead of writing dbg.log0('Bucket_log_uploader: system_store did not finish initial load'); we should write: dbg.log0('system_store did not finish initial load');
  2. please add javadoc for typescript on every function.

config.js Outdated Show resolved Hide resolved
src/server/bg_services/bucket_logs_upload.js Show resolved Hide resolved
src/server/bg_services/bucket_logs_upload.js Outdated Show resolved Hide resolved
src/server/bg_services/bucket_logs_upload.js Outdated Show resolved Hide resolved
@aspandey aspandey force-pushed the bucket_logging_bg_worker branch 7 times, most recently from dac9516 to feea1ec Compare March 13, 2024 08:35
Comment on lines 280 to 284
required: ['name', 'log_bucket', 'log_prefix'],
properties: {
name: {
$ref: 'common_api#/definitions/bucket_name',
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's take it out into a different PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 136 to 137
let log_objects = null;
let log_file_path = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

decleration of variable does not require to be initiated with null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@aspandey aspandey force-pushed the bucket_logging_bg_worker branch 3 times, most recently from b903cff to 4295ad4 Compare March 14, 2024 07:46
Copy link
Contributor

@liranmauda liranmauda left a comment

Choose a reason for hiding this comment

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

LGTM

Bucket logs will be collected and placed on /log/noobaa_bucket_logs/
directory. The BG worker, BucketLogUploader,  will keep scanning this
directory and upload the object on a log bucket.
This log bucket name will be fetched from the log object name.

Signed-off-by: Ashish Pandey <aspandey@redhat.com>
@aspandey aspandey force-pushed the bucket_logging_bg_worker branch from 4295ad4 to cb0857e Compare March 14, 2024 09:49
@aspandey aspandey merged commit 34e501e into noobaa:master Mar 14, 2024
10 checks passed
@aspandey aspandey deleted the bucket_logging_bg_worker branch March 14, 2024 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants