mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update kubernetes to 1.28.0 in main
updating kubernetes to 1.28.0 in the main repo. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
b2fdc269c3
commit
ff3e84ad67
8
vendor/k8s.io/component-base/metrics/legacyregistry/registry.go
generated
vendored
8
vendor/k8s.io/component-base/metrics/legacyregistry/registry.go
generated
vendored
@ -18,6 +18,7 @@ package legacyregistry
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/collectors"
|
||||
@ -45,19 +46,22 @@ var (
|
||||
|
||||
// Registerer exposes the global registerer
|
||||
Registerer = defaultRegistry.Registerer
|
||||
|
||||
processStart time.Time
|
||||
)
|
||||
|
||||
func init() {
|
||||
RawMustRegister(collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}))
|
||||
RawMustRegister(collectors.NewGoCollector(collectors.WithGoCollectorRuntimeMetrics(collectors.MetricsAll)))
|
||||
defaultRegistry.RegisterMetaMetrics()
|
||||
processStart = time.Now()
|
||||
}
|
||||
|
||||
// Handler returns an HTTP handler for the DefaultGatherer. It is
|
||||
// already instrumented with InstrumentHandler (using "prometheus" as handler
|
||||
// name).
|
||||
func Handler() http.Handler {
|
||||
return promhttp.InstrumentMetricHandler(prometheus.DefaultRegisterer, promhttp.HandlerFor(defaultRegistry, promhttp.HandlerOpts{}))
|
||||
return promhttp.InstrumentMetricHandler(prometheus.DefaultRegisterer, promhttp.HandlerFor(defaultRegistry, promhttp.HandlerOpts{ProcessStartTime: processStart}))
|
||||
}
|
||||
|
||||
// HandlerWithReset returns an HTTP handler for the DefaultGatherer but invokes
|
||||
@ -65,7 +69,7 @@ func Handler() http.Handler {
|
||||
func HandlerWithReset() http.Handler {
|
||||
return promhttp.InstrumentMetricHandler(
|
||||
prometheus.DefaultRegisterer,
|
||||
metrics.HandlerWithReset(defaultRegistry, metrics.HandlerOpts{}))
|
||||
metrics.HandlerWithReset(defaultRegistry, metrics.HandlerOpts{ProcessStartTime: processStart}))
|
||||
}
|
||||
|
||||
// CustomRegister registers a custom collector but uses the global registry.
|
||||
|
Reference in New Issue
Block a user