Skip to content

Commit 5400f5a

Browse files
committed
lifecycle: log conductorScanId in object processor tasks
Extract conductorScanId from the ActionQueueEntry context in LifecycleDeleteObjectTask, LifecycleUpdateTransitionTask, and LifecycleUpdateExpirationTask processActionEntry() methods. Attach it to the logger default fields so every log line produced while processing an object action (delete, transition metadata update, restore expiration) carries the scan identifier. This completes the end-to-end propagation: the same scanId appears in conductor, bucket processor, lifecycle task, and object processor logs. BB-740
1 parent 30dbf45 commit 5400f5a

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

extensions/lifecycle/tasks/LifecycleDeleteObjectTask.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ class LifecycleDeleteObjectTask extends BackbeatTask {
304304
processActionEntry(entry, done) {
305305
const startTime = Date.now();
306306
const log = this.logger.newRequestLogger();
307+
const conductorScanId = entry.getContextAttribute(
308+
'conductorScanId');
309+
if (conductorScanId && typeof log.addDefaultFields === 'function') {
310+
log.addDefaultFields({ conductorScanId });
311+
}
307312
entry.addLoggedAttributes({
308313
bucketName: 'target.bucket',
309314
objectKey: 'target.key',

extensions/lifecycle/tasks/LifecycleUpdateExpirationTask.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ class LifecycleUpdateExpirationTask extends BackbeatTask {
150150
processActionEntry(entry, done) {
151151
const startTime = Date.now();
152152
const log = this.logger.newRequestLogger();
153+
const conductorScanId = entry.getContextAttribute(
154+
'conductorScanId');
155+
if (conductorScanId && typeof log.addDefaultFields === 'function') {
156+
log.addDefaultFields({ conductorScanId });
157+
}
153158
entry.addLoggedAttributes({
154159
bucketName: 'target.bucket',
155160
objectKey: 'target.key',

extensions/lifecycle/tasks/LifecycleUpdateTransitionTask.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ class LifecycleUpdateTransitionTask extends BackbeatTask {
260260
*/
261261
processActionEntry(entry, done) {
262262
const log = this.logger.newRequestLogger();
263+
const conductorScanId = entry.getContextAttribute(
264+
'conductorScanId');
265+
if (conductorScanId && typeof log.addDefaultFields === 'function') {
266+
log.addDefaultFields({ conductorScanId });
267+
}
263268
entry.addLoggedAttributes({
264269
bucketName: 'target.bucket',
265270
objectKey: 'target.key',

0 commit comments

Comments
 (0)