You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-api-machinery/4346-informer-metrics/README.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -237,8 +237,8 @@ nitty-gritty.
237
237
238
238
- Introduce the informer metrics struct `informerMetrics` contains queue/eventHandler metrics
239
239
- Introduce the informer metrics provider interface `informerMetricsProvider`, implement in `k8s.io/component-base/metrics`
240
-
- Add an environment to enable informer metrics
241
240
- Revert the deleted `reflectorMetrics`
241
+
- Add a feature gate `InformerMetrics` to enable informer/reflector metrics
242
242
243
243
### User Stories (Optional)
244
244
@@ -361,20 +361,19 @@ Each reflector metrics contains 3 counter, 4 summary and 1 gauge.
361
361
```
362
362
type reflectorMetrics struct {
363
363
numberOfLists CounterMetric
364
-
listDuration SummaryMetric
365
-
numberOfItemsInList SummaryMetric
364
+
listDuration HistogramMetric
365
+
numberOfItemsInList HistogramMetric
366
366
367
367
numberOfWatches CounterMetric
368
368
numberOfShortWatches CounterMetric
369
-
watchDuration SummaryMetric
370
-
numberOfItemsInWatch SummaryMetric
369
+
watchDuration HistogramMetric
370
+
numberOfItemsInWatch HistogramMetric
371
371
372
372
lastResourceVersion GaugeMetric
373
373
}
374
374
```
375
-
According to kubernetes/kubernetes#73587, the memory leak is caused by summary. Every summary contains `AgeBuckets`of buckets which contains an array with 500 quantile.Sample. Reduce summary `ageBuckets` to mitigate memory usage.
375
+
According to kubernetes/kubernetes#73587, the memory leak is caused by summary. It'd be better to use histograms instead. HistogramMetrics are aggregatable and it will reduce memory usage.
376
376
377
-
The listDuration/numberOfItemsInList/watchDuration/numberOfItemsInWatch will not `Observe` very frequently. According to [prometheus client](https://github.com/prometheus/client_golang/commit/15c9ded5a3b7ae08886e51ba26a97270ca23fecd#diff-4c7dc681b10f8e28a3d6a8cfd115c37cc473e6fc9b0949bd6b41eaedbdead438R132), it is enough to set `ageBuckets` to 1.
378
377
379
378
### Remove Metrics
380
379
When the informers and reflectors stopped, the reference metrics will be removed.
@@ -446,8 +445,11 @@ For Beta and GA, add links to added tests together with links to k8s-triage for
0 commit comments