POC: New structure for loki.process pipeline - #6872
Draft
kalleep wants to merge 7 commits into
Draft
Conversation
kalleep
force-pushed
the
kalleep/loki-process-consumer
branch
from
August 14, 2026 13:24
70fae0a to
55ce994
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Most loki components are trivial to change in order to support the new loki pipeline we are moving too but
loki.processis not.We have a couple of different types of stages:
I am pretty sure the last one is the reason why this component today is built up by starting each stage in it's own goroutine and chain them with channels.
This is problematic for the loki pipeline changes since with this structure a batch / entry sent down the pipeline would be disconnected from the original caller and this would still cause the same head-of-line blocking that exists today.
What we really want is for the stages them self just be function calls, just like component are going to be. In this pr I have experimented a bit with a new stage / pipeline interface. The best way to check how it would be used is to check the added test
TestPipeline2where I have added these different kind of stages we have today (simple ports).A couple of things I want to highlight:
stage.multilinecan flush entries on it's own we need an external trigger, this would most likely be up to the component to scan for nearest flush deadline from potentially several stages and call the flush function and forward the batch on it's own.Emitterinterface to every Process call, this allows a stage to emit multiple entries during on call. Another solution instead of this would be to change the signature of each stage to work on slices of entries instead and loop on each stage.