mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #78732 from mborsz/metric
Add 'apiserver_watch_events_total' metric.
This commit is contained in:
commit
74b5603f83
@ -225,6 +225,7 @@ func (s *WatchServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|||||||
// End of results.
|
// End of results.
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
metrics.WatchEvents.WithLabelValues(kind.Group, kind.Version, kind.Kind).Inc()
|
||||||
|
|
||||||
obj := s.Fixup(event.Object)
|
obj := s.Fixup(event.Object)
|
||||||
if err := s.EmbeddedEncoder.Encode(obj, buf); err != nil {
|
if err := s.EmbeddedEncoder.Encode(obj, buf); err != nil {
|
||||||
|
@ -141,6 +141,13 @@ var (
|
|||||||
},
|
},
|
||||||
[]string{"group", "version", "kind"},
|
[]string{"group", "version", "kind"},
|
||||||
)
|
)
|
||||||
|
WatchEvents = prometheus.NewCounterVec(
|
||||||
|
prometheus.CounterOpts{
|
||||||
|
Name: "apiserver_watch_events_total",
|
||||||
|
Help: "Number of events sent in watch clients",
|
||||||
|
},
|
||||||
|
[]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(
|
||||||
|
Loading…
Reference in New Issue
Block a user