Commit 9744eea
committed
receiver/k8sobjects: add persist_resource_version support for watch mode
Adds periodic checkpoint flushing to persist the latest resourceVersion
to storage every 5 seconds instead of writing on every event, reducing
storage I/O overhead.
Key changes:
- Add buffered checkpointer with in-memory pending map; Flush() drains
to persistent storage and is a no-op when nothing has changed
- Enforce high-watermark in SetCheckpoint: only update if new rv is
numerically greater, guarding against out-of-order List() responses
- Add startCheckpointFlusher() to encapsulate ticker + setLatestRV +
force-flush after sendInitialState to prevent 410 race window
- Filter already-seen objects in sendInitialState using persisted rv
- Delete persisted rv on 410 Gone to avoid replaying a stale checkpoint
- Validate that resource_version and persist_resource_version are not
set together in config
- Fix README example to use persistentVolumeClaim instead of emptyDir
Co-authored-by: Dhruv Shah <dhruv.shah@sumologic.com>1 parent 04802a4 commit 9744eea
11 files changed
Lines changed: 462 additions & 191 deletions
File tree
- internal/k8sinventory
- watch
- receiver
- k8seventsreceiver
- k8sobjectsreceiver
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
18 | 25 | | |
19 | 26 | | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
24 | | - | |
25 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
| |||
53 | 61 | | |
54 | 62 | | |
55 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
56 | 70 | | |
57 | | - | |
| 71 | + | |
58 | 72 | | |
59 | 73 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 74 | | |
65 | 75 | | |
66 | 76 | | |
67 | 77 | | |
68 | 78 | | |
69 | | - | |
70 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
71 | 82 | | |
72 | 83 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
76 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
77 | 128 | | |
78 | 129 | | |
79 | 130 | | |
| |||
0 commit comments