-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Component(s)
receiver/k8sobjects
What happened?
Description
Today, most users would want to use watch mode, so they can subscribe to events happening to the objects they are watching without the cost of pulling the snapshot periodically.
However, currently you can only track changes that happen AFTER you subscribed to objects, while I feel most users would also like to get the current state of the objects. Today you can only get this by using pull mode, and using pull mode only because of this can be undesired.
We can solve this via an initial List request (which the code already does today, but only to get the current resourceVersion when it is not specified).
I am proposing
- sending a
Listrequest to the object/group - converting this state into a log via
watchObjectsToLogDatainstartWatch() - watching from this resourceVersion as the code already does
See also the Kubernetes documentation on how to detect changes efficiently.
Note: there's also this, but requires a specific Kubernetes version: https://kubernetes.io/docs/reference/using-api/api-concepts/#streaming-lists
Steps to Reproduce
Configure the receiver to watch pods, add debugexporter to the pipeline.
Expected Result
The receiver should generate a log for the current state too.
Actual Result
No log events will be generated unless changes happen to pods after you have the receiver running.
Collector version
main
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.