mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update controller-runtime package to v0.9.2
This commit updates controller-runtime to v0.9.2 and makes changes in persistentvolume.go to add context to various functions and function calls made here instead of context.TODO(). Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
13
vendor/sigs.k8s.io/controller-runtime/pkg/metrics/client_go_adapter.go
generated
vendored
13
vendor/sigs.k8s.io/controller-runtime/pkg/metrics/client_go_adapter.go
generated
vendored
@ -17,6 +17,7 @@ limitations under the License.
|
||||
package metrics
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
@ -50,7 +51,7 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
// client metrics
|
||||
// client metrics.
|
||||
requestLatency = prometheus.NewHistogramVec(prometheus.HistogramOpts{
|
||||
Subsystem: RestClientSubsystem,
|
||||
Name: LatencyKey,
|
||||
@ -64,7 +65,7 @@ var (
|
||||
Help: "Number of HTTP requests, partitioned by status code, method, and host.",
|
||||
}, []string{"code", "method", "host"})
|
||||
|
||||
// reflector metrics
|
||||
// reflector metrics.
|
||||
|
||||
// TODO(directxman12): update these to be histograms once the metrics overhaul KEP
|
||||
// PRs start landing.
|
||||
@ -123,7 +124,7 @@ func init() {
|
||||
registerReflectorMetrics()
|
||||
}
|
||||
|
||||
// registerClientMetrics sets up the client latency metrics from client-go
|
||||
// registerClientMetrics sets up the client latency metrics from client-go.
|
||||
func registerClientMetrics() {
|
||||
// register the metrics with our registry
|
||||
Registry.MustRegister(requestLatency)
|
||||
@ -136,7 +137,7 @@ func registerClientMetrics() {
|
||||
})
|
||||
}
|
||||
|
||||
// registerReflectorMetrics sets up reflector (reconcile) loop metrics
|
||||
// registerReflectorMetrics sets up reflector (reconcile) loop metrics.
|
||||
func registerReflectorMetrics() {
|
||||
Registry.MustRegister(listsTotal)
|
||||
Registry.MustRegister(listsDuration)
|
||||
@ -162,7 +163,7 @@ type latencyAdapter struct {
|
||||
metric *prometheus.HistogramVec
|
||||
}
|
||||
|
||||
func (l *latencyAdapter) Observe(verb string, u url.URL, latency time.Duration) {
|
||||
func (l *latencyAdapter) Observe(_ context.Context, verb string, u url.URL, latency time.Duration) {
|
||||
l.metric.WithLabelValues(verb, u.String()).Observe(latency.Seconds())
|
||||
}
|
||||
|
||||
@ -170,7 +171,7 @@ type resultAdapter struct {
|
||||
metric *prometheus.CounterVec
|
||||
}
|
||||
|
||||
func (r *resultAdapter) Increment(code, method, host string) {
|
||||
func (r *resultAdapter) Increment(_ context.Context, code, method, host string) {
|
||||
r.metric.WithLabelValues(code, method, host).Inc()
|
||||
}
|
||||
|
||||
|
2
vendor/sigs.k8s.io/controller-runtime/pkg/metrics/registry.go
generated
vendored
2
vendor/sigs.k8s.io/controller-runtime/pkg/metrics/registry.go
generated
vendored
@ -26,5 +26,5 @@ type RegistererGatherer interface {
|
||||
}
|
||||
|
||||
// Registry is a prometheus registry for storing metrics within the
|
||||
// controller-runtime
|
||||
// controller-runtime.
|
||||
var Registry RegistererGatherer = prometheus.NewRegistry()
|
||||
|
Reference in New Issue
Block a user