chore(go.d): log skipped data collection (#21423)
Ilya Mashchenko committed
Dec 8, 2025 at 20:23 UTC
600d7febb7c3bdede030c8682c8017d8152b8190
1 file changed
+8
-1
src/go/plugin/go.d/agent/module/job.go
+8
-1
@@ -175,6 +175,8 @@ type Job struct {
175
// Dump mode support
176
dumpMode bool
177
dumpAnalyzer interface{} // Will be *agent.DumpAnalyzer but avoid circular dependency
178
+
179
+ consecutiveSkips int // tracks consecutive tick skips
180
}
181
182
type collectedMetrics struct {
@@ -299,8 +301,13 @@ func (j *Job) UpdateVnode(vnode *vnodes.VirtualNode) {
301
func (j *Job) Tick(clock int) {
302
select {
303
case j.tick <- clock:
304
+ j.consecutiveSkips = 0
305
default:
303
- j.Debug("skip the tick due to previous run hasn't been finished")
306
+ if j.consecutiveSkips++; j.consecutiveSkips >= 2 {
307
+ j.Warningf("skipping data collection: previous run is still in progress (skipped %d times in a row)", j.consecutiveSkips)
308
+ } else {
309
+ j.Info("skipping data collection: previous run is still in progress")
310
+ }
311
}
312
}
313