-
Notifications
You must be signed in to change notification settings - Fork 133
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
converting a few info into debug message #916
base: main
Are you sure you want to change the base?
Conversation
A taskRun/pipelineRun is watched as soon as created. Until the run is complete and ready to proceed further, the chains controller is logging that the taskRun/pipelineRun is still running at the info level. This looks good but generates a lot of info in the controller logs and exponentially increases with the number of taskRun and pipelineRun. Converting such message to be reported at the debug log level. Formatting a few error message such that the namespace/name is enclosed with parenthesis so that its easy to read. Signed-off-by: Priti Desai <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
@@ -59,14 +59,14 @@ func (r *Reconciler) ReconcileKind(ctx context.Context, pr *v1beta1.PipelineRun) | |||
func (r *Reconciler) FinalizeKind(ctx context.Context, pr *v1beta1.PipelineRun) pkgreconciler.Event { | |||
// Check to make sure the PipelineRun is finished. | |||
if !pr.IsDone() { | |||
logging.FromContext(ctx).Infof("pipelinerun is still running") | |||
logging.FromContext(ctx).Debugf("pipelinerun \"%s/%s\" is still running", pr.Namespace, pr.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of plumbing through the namespace/name in each log statement, you can set this in the context:
log := logging.FromContext(ctx).With(
"pipelinerun", fmt.Sprintf("%s/%s", pr.Namespace, pr.Name),
)
ctx = logging.WithLogger(ctx, log)
This will make sure that other logs further down the callstack have similar fields set!
@pritidesai: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@pritidesai are you still interested in driving this PR forward? |
Changes
A taskRun/pipelineRun is watched as soon as created. Until the run is complete and ready to proceed further, the chains controller is logging that the taskRun/pipelineRun is still running at the info level. This looks good but generates a lot of info in the controller logs and exponentially increases with the number of taskRuns and pipelineRuns. Converting such message to be reported at the debug log level.
Formatting a few error message such that the namespace/name is enclosed with parenthesis so that its easy to read.
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes