Skip to content

🌱 Add debug logging for the state of the priority queue - #3075

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
alvaroaleman:logs
Jan 20, 2025
Merged

k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
alvaroaleman:logs

Conversation

@alvaroaleman

Copy link
Copy Markdown
Member

This debug logging prints the state of the workqueue in order to allow debugging it. It will continously check at runtime if debug logging is enabled and do nothing if not, making it very cheap if unused.

Sample output piped through jq for readability:

{
  "level": "debug",
  "ts": "2025-01-19T12:00:43-05:00",
  "msg": "workqueue_state",
  "controller": "configmap",
  "items": [
    {
      "key": {
        "Namespace": "kube-system",
        "Name": "kubeadm-config"
      },
      "addedCounter": 1,
      "priority": -100
    }
  ]
}

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 19, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 19, 2025
addedCounter uint64
priority int
readyAt *time.Time
Key T `json:"key"`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Exporting these is required for the json marshalling, otherwise they get omitted

Comment thread examples/priorityqueue/main.go Resolved
This debug logging prints the state of the workqueue in order to allow
debugging it. It will continously check at runtime if debug logging is
enabled and do nothing if not, making it very cheap if unused.

Sample output piped through `jq` for readability:
```
{
  "level": "debug",
  "ts": "2025-01-19T12:00:43-05:00",
  "msg": "workqueue_state",
  "controller": "configmap",
  "items": [
    {
      "key": {
        "Namespace": "kube-system",
        "Name": "kubeadm-config"
      },
      "addedCounter": 1,
      "priority": -100
    }
  ]
}
```
@sbueringer

Copy link
Copy Markdown
Member

Thank you!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 20, 2025
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 389335b47acedc19b2616447330a433f4eb55b21

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, sbueringer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [alvaroaleman,sbueringer]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
k8s-ci-robot merged commit f06cac4 into kubernetes-sigs:main Jan 20, 2025
@alvaroaleman

Copy link
Copy Markdown
Member Author

/cherrypick release-0.20

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@alvaroaleman: new pull request created: #3088

Details

In response to this:

/cherrypick release-0.20

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants