Skip to content

Conversation

@kalleep
Copy link
Contributor

@kalleep kalleep commented Dec 8, 2025

PR Description

loki.source.docker suffered from the same issue that loki.source.file did where scheduling could take some time for new targets.

In this pr I move Scheduler to source package so I can be reused by both components. With this I also moved "target" into docker package and rename to tailer, this tailer now implements Source interface.

I also fixed a issue where stopping component could deadlock if nothing was reading from handler chan.

Which issue(s) this PR fixes

Related to: #4729

Notes to the Reviewer

  • Moved target and metrics from internal package to tailer.go and metrics.go and they are no longer exported.

  • Created a shared structure Fanout, this implements the common pattern to abort send operation if context is canceled.

  • Create shared function Consume to run the consume loop that will abort if context is canceled.

  • Create shared function Drain that can be used when component is stopped.

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@kalleep kalleep requested a review from a team as a code owner December 8, 2025 13:16
@kalleep kalleep force-pushed the kalleep/loki-source-docker-scheduling branch from 18c614f to bf16415 Compare December 8, 2025 13:17
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.

1 participant