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

converting a few info into debug message #916

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pritidesai
Copy link
Member

@pritidesai pritidesai commented Sep 7, 2023

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:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

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]>
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign wlynch after the PR has been reviewed.
You can assign the PR to them by writing /assign @wlynch in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 7, 2023
@pritidesai
Copy link
Member Author

/retest

@pritidesai pritidesai closed this Sep 12, 2023
@pritidesai pritidesai reopened this Sep 12, 2023
@@ -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)
Copy link
Member

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!

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 17, 2024
@tekton-robot
Copy link

@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.

@lcarva
Copy link
Contributor

lcarva commented Oct 15, 2024

@pritidesai are you still interested in driving this PR forward?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants