node-driver-registrar icon indicating copy to clipboard operation
node-driver-registrar copied to clipboard

Support structured logging

Open jcogilvie opened this issue 2 years ago • 5 comments

The node-driver-registrar container should support structured logging when given the --log-format-json flag, like for instance the secrets-store-csi-driver does.

A simple implementation can be found here: https://github.com/kubernetes-sigs/secrets-store-csi-driver/blob/main/cmd/secrets-store-csi-driver/main.go#L90-L94

jcogilvie avatar Oct 13 '22 21:10 jcogilvie

Thanks for the pointer, I was reading how the kubelet does it and it's very similar, on top of this change we need to update the log methods to the suffix S e.g. Infof -> InfoS, etc

References:

  • https://kubernetes.io/blog/2020/09/04/kubernetes-1-19-introducing-structured-logs/
  • kubelet
    • init https://github.com/kubernetes/component-base/blob/v0.25.3/logs/json/register/register.go#L26,
    • setup https://github.com/kubernetes/kubernetes/blob/v1.25.3/cmd/kubelet/app/options/options.go#L521 -> https://github.com/kubernetes/component-base/blob/v0.25.3/logs/api/v1/options.go#L185

mauriciopoppe avatar Oct 17 '22 20:10 mauriciopoppe

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

This bot triages 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 PR is closed

You can:

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

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

/lifecycle stale

k8s-triage-robot avatar Feb 08 '23 09:02 k8s-triage-robot

/remove-lifecycle stale

jcogilvie avatar Feb 08 '23 16:02 jcogilvie

If that's ok and nobody it is working on this issue, I'd like to take this one

chenliu1993 avatar Mar 11 '23 06:03 chenliu1993

If that's ok and nobody it is working on this issue, I'd like to take this one

Seems there is already a PR working on this issue, so I am not taking this one

chenliu1993 avatar Mar 11 '23 07:03 chenliu1993