feat: Add clustering for loki.source.kubernetes_events#6027
feat: Add clustering for loki.source.kubernetes_events#6027
loki.source.kubernetes_events#6027Conversation
This change adds a `clustering` option for `loki.source.kubernetes_events` that will distribute the work according to the list. If no namespaces are specificied, then only a single instance will run. This is great, because it means that it will be safe to run on Alloy instances with multiple replicas without resulting in duplication. Signed-off-by: Pete Wall <pete.wall@grafana.com>
|
💻 Deploy preview available (feat: Add clustering for |
|
Cool but I do think we will have at least one problem, that The problem here and with that other component is that if a target moves to another instance we loose track of where we should start reading from and would start from beginning. Not really a blocker itself but we should look into how we can solve this for both this one and |
|
A bit of testing:
Both control-group alloy replicas reported the same events (duplication) |
Signed-off-by: Pete Wall <pete.wall@grafana.com>
There's some good points here, but I'm not sure if it's big enough deal to hold this up. By default the TTL for kubernetes events is 1 hour, so any duplication would be bounded by that. And I feel the benefits (no more requirement for a singleton deployment) outweigh the concerns (potential short-term log duplication). Is there an existing issue or a TODO for this, and we can try and fix that in another PR? |
…ed alloy pod churn Signed-off-by: Pete Wall <pete.wall@grafana.com>
Yeah there is a issue for loki.source.kubernetes as mentioned in slack. But I saw that you added a note about this and that is enough I think. |
Brief description of Pull Request
This change adds a
clusteringoption forloki.source.kubernetes_eventsthat will distribute the work according to the list. If no namespaces are specificied, then only a single instance will run. This is great, because it means that it will be safe to run on Alloy instances with multiple replicas without resulting in duplication.Pull Request Details
Issue(s) fixed by this Pull Request
Fixes #401
Notes to the Reviewer
PR Checklist