mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Merge pull request #80477 from mborsz/eventssize
Add 'apiserver_watch_events_sizes'
This commit is contained in:
commit
ff1e1127e2
@ -238,6 +238,7 @@ func (s *WatchServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|||||||
// type
|
// type
|
||||||
unknown.Raw = buf.Bytes()
|
unknown.Raw = buf.Bytes()
|
||||||
event.Object = &unknown
|
event.Object = &unknown
|
||||||
|
metrics.WatchEventsSizes.WithLabelValues(kind.Group, kind.Version, kind.Kind).Observe(float64(len(unknown.Raw)))
|
||||||
|
|
||||||
*outEvent = metav1.WatchEvent{}
|
*outEvent = metav1.WatchEvent{}
|
||||||
|
|
||||||
|
@ -148,6 +148,14 @@ var (
|
|||||||
},
|
},
|
||||||
[]string{"group", "version", "kind"},
|
[]string{"group", "version", "kind"},
|
||||||
)
|
)
|
||||||
|
WatchEventsSizes = prometheus.NewHistogramVec(
|
||||||
|
prometheus.HistogramOpts{
|
||||||
|
Name: "apiserver_watch_events_sizes",
|
||||||
|
Help: "Watch event size distribution in bytes",
|
||||||
|
Buckets: prometheus.ExponentialBuckets(1024, 2.0, 8), // 1K, 2K, 4K, 8K, ..., 128K.
|
||||||
|
},
|
||||||
|
[]string{"group", "version", "kind"},
|
||||||
|
)
|
||||||
// Because of volatality of the base metric this is pre-aggregated one. Instead of reporing current usage all the time
|
// Because of volatality of the base metric this is pre-aggregated one. Instead of reporing current usage all the time
|
||||||
// it reports maximal usage during the last second.
|
// it reports maximal usage during the last second.
|
||||||
currentInflightRequests = prometheus.NewGaugeVec(
|
currentInflightRequests = prometheus.NewGaugeVec(
|
||||||
@ -171,6 +179,7 @@ var (
|
|||||||
DeprecatedDroppedRequests,
|
DeprecatedDroppedRequests,
|
||||||
RegisteredWatchers,
|
RegisteredWatchers,
|
||||||
WatchEvents,
|
WatchEvents,
|
||||||
|
WatchEventsSizes,
|
||||||
currentInflightRequests,
|
currentInflightRequests,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user