Skip to content

Migrate scheduler to structured logging #105841

@pchan

Description

@pchan

What would you like to be added?

Enhance scheduler logging and address current issues.

  1. Migrate the current unstructured logs to structured logging.
    • Klog APIs of unstructured logs are found in 2 directories (cmd/kube-scheduler, pkg/scheduler)
    • Primarily files in pkg/scheduler/framework and pkg/scheduler/internal needs to be migrated. I will update this issue with the API breakdown at the file level.
  2. One improvement that would be nice to have is logging a unique key for each pod through its scheduling cycle. This was raised in Do contextual logging for scheduler #91633. Need tracing for this, will need to work with SIG instrumentation and do more analysis.

Authors

What to include in your PR

Subject: "Migrate to structured logging"
SIGs: instrumentation, node
Priority: important-soon
Kind: cleanup
HOW TO: Read the structured logging migration guide.

Please reference this issue for scheduler migrations.

Before you submit your PR, check to see if someone has already migrated that component: https://github.com/kubernetes/kubernetes/pulls?q=is%3Apr+is%3Aopen+structured+log+label%3Asig%2Fnode

Reviewers:

Read through the migration guide above. Use the PR query above to find PRs to review.

Why is this needed?

To get the benefits of structured logging.

kubernetes/enhancements#1602

/wg structured-logging
/sig scheduling
/area logging
/priority important-longterm
/kind cleanup
/cc @kubernetes/wg-structured-logging-reviews
/cc @damemi

Metadata

Metadata

Labels

area/loggingkind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.kind/featureCategorizes issue or PR as related to a new feature.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.sig/instrumentationCategorizes an issue or PR as relevant to SIG Instrumentation.sig/schedulingCategorizes an issue or PR as relevant to SIG Scheduling.triage/acceptedIndicates an issue or PR is ready to be actively worked on.wg/structured-loggingCategorizes an issue or PR as relevant to WG Structured Logging.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions