vectordotdev / vector

A high-performance observability data pipeline.
https://vector.dev
Mozilla Public License 2.0
17.37k stars 1.51k forks source link

inotify support for kubernetes_logs #20541

Open mrzor opened 3 months ago

mrzor commented 3 months ago

A note for the community

Use Cases

Some pods may succeed (enter the Succeeded state) very quickly. The lifecycle of the log folder is presently tied to the pod lifecycle itself, and the duration during which it is tracked is not straightforward to control (it is actually unclear to what extent that can be controlled at all).

Attempted Solutions

Proposal

I can't do much outside of expressing my strong support for inotify support for the kubernetes source. That may or may not be implemented as part of the file source. It could be an entirely new source on which to base the kubernetes source.

In some of the referenced issues, an argument for platform-independence was made. While the file source certainly has to be platform independent, why should the kubernetes one be? I claim no expertise on the matters of Kubernetes on Windows, but a quick look at the Kubernetes | Windows User Guide | Capturing logs from workloads indicates that the prefered way is not to use files at all. Because of that, it seems to me that the kubernetes source does not support Windows adequately today - and as such, the platform independence argument is moot. Outside of Linux, Kubernetes only runs on Windows as far as I'm aware (k8s/BSD is hardly a thing).

One should not have to choose between efficiency and deliverability, which is the tradeoff we have to make here. Let's have both with inotify !

References

Version

vector 0.36.0 (x86_64-unknown-linux-gnu)

jszwedko commented 3 months ago

Thanks for these thoughts @mrzor ! We had discussed this a bit before and I think we'd be open to seeing inotify used in the kubernetes_logs source and also the file source so long as there is also a fallback mechanism (scanning).