mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Add 'apiserver_terminated_watchers_total'
This commit is contained in:
parent
46d481b455
commit
342ad48feb
@ -1236,6 +1236,7 @@ func (c *cacheWatcher) add(event *watchCacheEvent, timer *time.Timer) bool {
|
|||||||
// Since we don't want to block on it infinitely,
|
// Since we don't want to block on it infinitely,
|
||||||
// we simply terminate it.
|
// we simply terminate it.
|
||||||
klog.V(1).Infof("Forcing watcher close due to unresponsiveness: %v", c.objectType.String())
|
klog.V(1).Infof("Forcing watcher close due to unresponsiveness: %v", c.objectType.String())
|
||||||
|
terminatedWatchersCounter.WithLabelValues(c.objectType.String()).Inc()
|
||||||
c.forget()
|
c.forget()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,15 @@ var (
|
|||||||
[]string{"resource"},
|
[]string{"resource"},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
terminatedWatchersCounter = metrics.NewCounterVec(
|
||||||
|
&metrics.CounterOpts{
|
||||||
|
Name: "apiserver_terminated_watchers_total",
|
||||||
|
Help: "Counter of watchers closed due to unresponsiveness broken by resource type.",
|
||||||
|
StabilityLevel: metrics.ALPHA,
|
||||||
|
},
|
||||||
|
[]string{"resource"},
|
||||||
|
)
|
||||||
|
|
||||||
watchCacheCapacityIncreaseTotal = metrics.NewCounterVec(
|
watchCacheCapacityIncreaseTotal = metrics.NewCounterVec(
|
||||||
&metrics.CounterOpts{
|
&metrics.CounterOpts{
|
||||||
Name: "watch_cache_capacity_increase_total",
|
Name: "watch_cache_capacity_increase_total",
|
||||||
@ -69,6 +78,7 @@ var (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
legacyregistry.MustRegister(initCounter)
|
legacyregistry.MustRegister(initCounter)
|
||||||
|
legacyregistry.MustRegister(terminatedWatchersCounter)
|
||||||
legacyregistry.MustRegister(watchCacheCapacityIncreaseTotal)
|
legacyregistry.MustRegister(watchCacheCapacityIncreaseTotal)
|
||||||
legacyregistry.MustRegister(watchCacheCapacityDecreaseTotal)
|
legacyregistry.MustRegister(watchCacheCapacityDecreaseTotal)
|
||||||
legacyregistry.MustRegister(watchCacheCapacity)
|
legacyregistry.MustRegister(watchCacheCapacity)
|
||||||
|
Loading…
Reference in New Issue
Block a user