Skip to content

Feature idea: extend logging by the leader / follower status of replica #3342

@mimowo

Description

@mimowo

/kind feature

I would like to consider extending the set of injected key-value pairs by controller-runtime to include the "replicaRole" key, indicating "leader" or "follower". This could be either by default, or opt-in when wiring a controller or webhook.

This would be very helpful when filtering logs for debugging to quickly see all logs, and only those from the "leader".

I'm exploring the solution inside controller-runtime as it is already injecting some key-value pairs into the logger, plus it is aware of leader election.

The motivation is this effort in Kueue: kubernetes-sigs/kueue#6772, and probably a workaround is possible using LogConstructor option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions