kcp icon indicating copy to clipboard operation
kcp copied to clipboard

Add more context info in all KCP logs, especially the logical cluster name and possibly workload cluster name

Open davidfestal opened this issue 3 years ago • 5 comments

Is your feature request related to a problem? Please describe.

On shared KCP environments with a number of organizations, workspaces, and registered workload clusters, it can be really hard to locate logs that relate to a given support problem, because a number of log messages are lacking required context information. For example:

processing discovery for resource deployments (deployments.apps) 

doesn't show for which logical cluster and workload cluster this action occurs.

Describe the solution you'd like

It would greatly help support to include context information like (at least logical cluster name and workload cluster name) in every log message where they make sense. Additionally, printing them with always the same formatting (structural logging ?) would make it really easier to filter the logs based on this context information.

davidfestal avatar Mar 23 '22 10:03 davidfestal

cc @kylape @csams

davidfestal avatar Mar 23 '22 10:03 davidfestal

Beware rebase cost.

sttts avatar Mar 24 '22 14:03 sttts

Removed the "good first issue". I am not sure we want that. Doing it throughout our kube fork will be costly.

sttts avatar Mar 24 '22 14:03 sttts

I agree about the Kube fork. I was at first thinking of KCP code at least: the example mentioned is pure KCP code.

davidfestal avatar Mar 24 '22 16:03 davidfestal

This IMHO should come after refactoring kcp to use logr/v2 and structured logs.

stevekuznetsov avatar Mar 24 '22 18:03 stevekuznetsov