@@ -20,7 +20,7 @@ import (
|
||||
"crypto/tls"
|
||||
"sync"
|
||||
|
||||
"gopkg.in/fsnotify.v1"
|
||||
"github.com/fsnotify/fsnotify"
|
||||
logf "sigs.k8s.io/controller-runtime/pkg/internal/log"
|
||||
)
|
||||
|
||||
|
||||
36
vendor/sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics/metrics.go
generated
vendored
36
vendor/sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics/metrics.go
generated
vendored
@@ -23,16 +23,6 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// TotalRequests is a prometheus metric which counts the total number of requests that
|
||||
// the webhook server has received.
|
||||
TotalRequests = prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Name: "controller_runtime_webhook_requests_total",
|
||||
Help: "Total number of admission requests",
|
||||
},
|
||||
[]string{"webhook", "succeeded"},
|
||||
)
|
||||
|
||||
// RequestLatency is a prometheus metric which is a histogram of the latency
|
||||
// of processing admission requests.
|
||||
RequestLatency = prometheus.NewHistogramVec(
|
||||
@@ -42,10 +32,30 @@ var (
|
||||
},
|
||||
[]string{"webhook"},
|
||||
)
|
||||
|
||||
// RequestTotal is a prometheus metric which is a counter of the total processed admission requests.
|
||||
RequestTotal = func() *prometheus.CounterVec {
|
||||
return prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Name: "controller_runtime_webhook_requests_total",
|
||||
Help: "Total number of admission requests by HTTP status code.",
|
||||
},
|
||||
[]string{"webhook", "code"},
|
||||
)
|
||||
}()
|
||||
|
||||
// RequestInFlight is a prometheus metric which is a gauge of the in-flight admission requests.
|
||||
RequestInFlight = func() *prometheus.GaugeVec {
|
||||
return prometheus.NewGaugeVec(
|
||||
prometheus.GaugeOpts{
|
||||
Name: "controller_runtime_webhook_requests_in_flight",
|
||||
Help: "Current number of admission requests being served.",
|
||||
},
|
||||
[]string{"webhook"},
|
||||
)
|
||||
}()
|
||||
)
|
||||
|
||||
func init() {
|
||||
metrics.Registry.MustRegister(
|
||||
TotalRequests,
|
||||
RequestLatency)
|
||||
metrics.Registry.MustRegister(RequestLatency, RequestTotal, RequestInFlight)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user