Giter VIP home page Giter VIP logo

Comments (26)

alculquicondor avatar alculquicondor commented on June 11, 2024 1

I'm fine waiting for v3 or replacing zapper with klogr.

I don't want to loose contextual logging.

from kueue.

denkensk avatar denkensk commented on June 11, 2024

/cc @ahg-g @alculquicondor

from kueue.

denkensk avatar denkensk commented on June 11, 2024

/kind cleanup

from kueue.

ArangoGutierrez avatar ArangoGutierrez commented on June 11, 2024

much agree, klog is soo much better

from kueue.

ArangoGutierrez avatar ArangoGutierrez commented on June 11, 2024

/assign

from kueue.

alculquicondor avatar alculquicondor commented on June 11, 2024

Let's reach to some level of agreement before we jump into implementing :)

If this is juts about format, I believe there are different zap configurations we can use. This is actually my first time using zap, so I'm not really sure what's possible.

While klog format might be better, the framework doesn't currently support contextual logging, which simplifies building structured logging a lot.
But this is changing soon https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/3077-contextual-logging

In the meantime, if we stick with logr for now, I think it will be easier to switch to klog (v3?) once it supports contextual logging.

from kueue.

ArangoGutierrez avatar ArangoGutierrez commented on June 11, 2024

let's defer this to klog/v3 but keep circling back here. I am a klog fan for sure

from kueue.

alculquicondor avatar alculquicondor commented on June 11, 2024

is there a better format we can use for zap?

from kueue.

ArangoGutierrez avatar ArangoGutierrez commented on June 11, 2024

This is why I don't like logr

1.6454820377420967e+09  ERROR   job-reconciler  Unsuspending job        {"job": {"name":"sample-job","namespace":"default"}, "error": "Operation cannot be fulfilled on jobs.batch \"sample-jo
b\": the object has been modified; please apply your changes to the latest version and try again"}                                                                                            sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile                 
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:114                                
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler          
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:311
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem       
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2             
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227
1.6454820377421455e+09  ERROR   controller.job  Reconciler error        {"reconciler group": "batch", "reconciler kind": "Job", "name": "sample-job", "namespace": "default", "error": "Operat
ion cannot be fulfilled on jobs.batch \"sample-job\": the object has been modified; please apply your changes to the latest version and try again"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem       
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2             
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227

had the similar erro/logs on NFD when using logr, and got rid by moving to klog/v2

from kueue.

alculquicondor avatar alculquicondor commented on June 11, 2024

Can you try to migrate to https://github.com/kubernetes/klog/tree/main/klogr?

from kueue.

ArangoGutierrez avatar ArangoGutierrez commented on June 11, 2024

I'm fine waiting for v3 or replacing zapper with klogr.

I don't want to loose contextual logging.

Since we are on a hold here
/unassign

from kueue.

alculquicondor avatar alculquicondor commented on June 11, 2024

You could always give klogr a try

from kueue.

ahg-g avatar ahg-g commented on June 11, 2024

/kind cleanup

from kueue.

ahg-g avatar ahg-g commented on June 11, 2024

What is the status of this?

from kueue.

alculquicondor avatar alculquicondor commented on June 11, 2024

I disabled the dev mode for the binary, so the output is all structured now:

{"level":"Level(-2)","ts":1649793642.0015297,"logger":"controller.clusterqueue","msg":"Reconciling ClusterQueue","reconciler group":"kueue.x-k8s.io","reconciler kind":"ClusterQueue","name":"cluster-total","namespace":"","clusterQueue":{"name":"cluster-total"}}

It looks like klog made progress towards contextual logging https://github.com/kubernetes/klog/blob/main/contextual.go

Let me ask what's the status of it.

from kueue.

alculquicondor avatar alculquicondor commented on June 11, 2024

Documentation is up here:

https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md

Kueue using it will help it mature.

/help

from kueue.

k8s-ci-robot avatar k8s-ci-robot commented on June 11, 2024

@alculquicondor:
This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

Documentation is up here:

https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md

Kueue using it will help it mature.

/help

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.

from kueue.

k8s-triage-robot avatar k8s-triage-robot commented on June 11, 2024

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

from kueue.

alculquicondor avatar alculquicondor commented on June 11, 2024

/help
to migrate to klog's contextual logging.

from kueue.

alculquicondor avatar alculquicondor commented on June 11, 2024

/remove-lifecycle stale
/priority backlog

from kueue.

alculquicondor avatar alculquicondor commented on June 11, 2024

I just realized that kubernetes uses zap to do json output through klog.

klog's contextual logging implements the logr.Logger interface. So it doesn't look like we benefit much migrating to klog, given that controller-runtime already expects a Logger.

However, there are some logs for which we are receiving the wrong call reference. I'll see if there is something we can do kubernetes-sigs/controller-runtime#1737

from kueue.

alculquicondor avatar alculquicondor commented on June 11, 2024

I managed to fix it, but we'll have to leave this until there's a controller-runtime release kubernetes-sigs/controller-runtime#1975

from kueue.

alculquicondor avatar alculquicondor commented on June 11, 2024

/help cancel

from kueue.

k8s-triage-robot avatar k8s-triage-robot commented on June 11, 2024

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

from kueue.

alculquicondor avatar alculquicondor commented on June 11, 2024

/lifecycle stale

We should be able to upgrade controller-runtime to have the fix

/help

from kueue.

kannon92 avatar kannon92 commented on June 11, 2024

I'll take a look at this. /assign @kannon92

from kueue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.