From 9a848eee7806e40dfcad2a51a3bedc2ed7288462 Mon Sep 17 00:00:00 2001 From: Rafi Shamim Date: Tue, 5 Nov 2024 17:07:49 -0500 Subject: [PATCH] jobs: don't redact job ID in log tags This will assist with debugging. Release note: None --- pkg/jobs/registry.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/jobs/registry.go b/pkg/jobs/registry.go index 7701589ee721..6c3df1adc1c4 100644 --- a/pkg/jobs/registry.go +++ b/pkg/jobs/registry.go @@ -44,6 +44,7 @@ import ( "github.com/cockroachdb/errors" "github.com/cockroachdb/errors/oserror" "github.com/cockroachdb/logtags" + "github.com/cockroachdb/redact" ) // adoptedJobs represents the epoch and cancellation of a job id being run by @@ -1697,8 +1698,7 @@ func (r *Registry) stepThroughStateMachine( return errors.NewAssertionErrorWithWrappedErrf(jobErr, "job %d: resuming with non-nil error", job.ID()) } - resumeCtx := logtags.AddTag(ctx, "job", - fmt.Sprintf("%s id=%d", jobType, job.ID())) + resumeCtx := logtags.AddTag(ctx, "job", redact.Sprintf("%s id=%d", jobType, job.ID())) // Adding all tags as pprof labels (including the one we just added for job // type and id). resumeCtx, undo := pprofutil.SetProfilerLabelsFromCtxTags(resumeCtx)