Skip to content

chore: Use slog in runtime package#6031

Merged
kalleep merged 3 commits intomainfrom
kalleep/change-logger
Apr 13, 2026
Merged

chore: Use slog in runtime package#6031
kalleep merged 3 commits intomainfrom
kalleep/change-logger

Conversation

@kalleep
Copy link
Copy Markdown
Contributor

@kalleep kalleep commented Apr 10, 2026

Pull Request Details

Start moving to use slog.Logger instead of go-kit/log.

This will only change usage in runtime and I will follow up with pr(s) to migrate component usage. Eventually we can get rid of some wrappers and clean-up it a bit.

Issue(s) fixed by this Pull Request

Part of: #4813

Notes to the Reviewer

PR Checklist

  • Documentation added
  • Tests updated
  • Config converters updated

@kalleep kalleep marked this pull request as ready for review April 10, 2026 12:55
@kalleep kalleep requested a review from a team as a code owner April 10, 2026 12:55
@kalleep kalleep changed the title POC: use slog in runtime package chore: use slog in runtime package Apr 10, 2026
@kalleep kalleep changed the title chore: use slog in runtime package chore: Use slog in runtime package Apr 10, 2026
@kgeckhart kgeckhart requested a review from Copilot April 10, 2026 17:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the runtime/controller logging flow from go-kit/log (+ logging/level) toward log/slog, as a first step in the broader effort to replace go-kit/log across the codebase.

Changes:

  • Switched several runtime/controller log callsites from level.<X>(log.Logger).Log(...) to (*slog.Logger).<X>(...) and updated logger plumbing accordingly.
  • Added (*logging.Logger).Slog() and a logging.NewSlogNop() helper to support slog.Logger usage while preserving dynamic logging updates.
  • Updated controller scheduler tests to use slog-backed logging.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/runtime/module.go Stores/uses a *slog.Logger for module controller logging.
internal/runtime/logging/logger.go Adds Slog() adapter and NewSlogNop() to produce *slog.Logger.
internal/runtime/internal/controller/scheduler.go Converts scheduler/task logging and logger types to *slog.Logger.
internal/runtime/internal/controller/scheduler_test.go Updates tests to use slog-backed loggers and validates warning/error output.
internal/runtime/internal/controller/node_custom_component.go Removes unused go-kit logger plumbing from custom component node.
internal/runtime/internal/controller/node_config_logging.go Types logging config node logger as *logging.Logger and removes casting.
internal/runtime/internal/controller/node_config_import.go Converts import node logging to *slog.Logger (while still using go-kit logger for managed component options).
internal/runtime/internal/controller/node_config_foreach.go Converts foreach node logging and helper signatures to *slog.Logger.
internal/runtime/internal/controller/loader.go Converts loader logging and related helper signatures to *slog.Logger.
internal/runtime/internal/controller/component_references.go Updates component reference warnings to use *slog.Logger.
internal/runtime/alloy.go Switches runtime controller logger to *slog.Logger and updates log callsites.

Copy link
Copy Markdown
Contributor

@kgeckhart kgeckhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's so nice to no longer have to do "msg", .............

@kalleep kalleep merged commit 3017351 into main Apr 13, 2026
57 of 59 checks passed
@kalleep kalleep deleted the kalleep/change-logger branch April 13, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants