Skip to content

updated logging in inferencepool reconciler #399

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

Merged
merged 2 commits into from
Feb 25, 2025

Conversation

nirrozenbaum
Copy link
Contributor

use the .WithValues function instead of having to specify the NamespacedName in every log line.

@k8s-ci-robot k8s-ci-robot requested a review from Jeffwan February 24, 2025 12:12
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 24, 2025
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 24, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @nirrozenbaum. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 24, 2025
Copy link

netlify bot commented Feb 24, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit d86fc39
🔍 Latest deploy log https://app.netlify.com/sites/gateway-api-inference-extension/deploys/67bdf0870427cf00082fdb8b
😎 Deploy Preview https://deploy-preview-399--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kfswain
Copy link
Collaborator

kfswain commented Feb 24, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 24, 2025
Copy link
Contributor

@ahg-g ahg-g left a comment

Choose a reason for hiding this comment

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

Thanks

logger := log.FromContext(ctx)
loggerDefault := logger.V(logutil.DEFAULT)
loggerDefault.Info("Reconciling InferencePool", "name", req.NamespacedName)
logger := log.FromContext(ctx).WithValues("Request.NamespacedName", req.NamespacedName).V(logutil.DEFAULT)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
logger := log.FromContext(ctx).WithValues("Request.NamespacedName", req.NamespacedName).V(logutil.DEFAULT)
logger := log.FromContext(ctx).WithValues("inferencePool", req.NamespacedName).V(logutil.DEFAULT)
ctx = ctrl.LoggerInto(ctx, logger)

putting it back into the context preservers the value downstream.

@nirrozenbaum
Copy link
Contributor Author

@ahg-g thanks for the comments.
I need to rebase the PR after #398 was merged, I will update your comments and push again.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 24, 2025
Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com>
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed 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. labels Feb 25, 2025
@ahg-g
Copy link
Contributor

ahg-g commented Feb 25, 2025

@nirrozenbaum there is an extra file in this PR, can you pls remove it?

after adding predicate to the controller registration, the reconcile function no longer contains the filtering logic.
therefore, it's not relecant to test the reconcile function with pool2.

in runtime, this event will be filtered out much earlier

Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com>
@nirrozenbaum
Copy link
Contributor Author

@nirrozenbaum there is an extra file in this PR, can you pls remove it?

yes, sorry.
removed.

@ahg-g
Copy link
Contributor

ahg-g commented Feb 25, 2025

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 25, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g, nirrozenbaum

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 25, 2025
@k8s-ci-robot k8s-ci-robot merged commit 2a88b3b into kubernetes-sigs:main Feb 25, 2025
8 checks passed
@nirrozenbaum nirrozenbaum deleted the inferencepool-logging branch February 25, 2025 16:58
kaushikmitr pushed a commit to kaushikmitr/llm-instance-gateway that referenced this pull request Feb 27, 2025
* updated logging + predicate in inferencepool reconciler

Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com>

* removed irrelevant unit test.

after adding predicate to the controller registration, the reconcile function no longer contains the filtering logic.
therefore, it's not relecant to test the reconcile function with pool2.

in runtime, this event will be filtered out much earlier

Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com>

---------

Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com>
kfswain pushed a commit to kfswain/llm-instance-gateway that referenced this pull request Apr 29, 2025
* updated logging + predicate in inferencepool reconciler

Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com>

* removed irrelevant unit test.

after adding predicate to the controller registration, the reconcile function no longer contains the filtering logic.
therefore, it's not relecant to test the reconcile function with pool2.

in runtime, this event will be filtered out much earlier

Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com>

---------

Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com>
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants