mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #83223 from RainbowMango/pr_remove_direct_reference_to_prom_label
Remove direct reference to prometheus.Label
This commit is contained in:
commit
7342823f3e
@ -29,7 +29,6 @@ go_library(
|
|||||||
"//staging/src/k8s.io/client-go/pkg/version:go_default_library",
|
"//staging/src/k8s.io/client-go/pkg/version:go_default_library",
|
||||||
"//staging/src/k8s.io/component-base/metrics:go_default_library",
|
"//staging/src/k8s.io/component-base/metrics:go_default_library",
|
||||||
"//staging/src/k8s.io/component-base/metrics/legacyregistry:go_default_library",
|
"//staging/src/k8s.io/component-base/metrics/legacyregistry:go_default_library",
|
||||||
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
|
|
||||||
"//vendor/github.com/vmware/govmomi/find:go_default_library",
|
"//vendor/github.com/vmware/govmomi/find:go_default_library",
|
||||||
"//vendor/github.com/vmware/govmomi/object:go_default_library",
|
"//vendor/github.com/vmware/govmomi/object:go_default_library",
|
||||||
"//vendor/github.com/vmware/govmomi/pbm:go_default_library",
|
"//vendor/github.com/vmware/govmomi/pbm:go_default_library",
|
||||||
|
@ -19,8 +19,6 @@ package vclib
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
|
||||||
|
|
||||||
"k8s.io/component-base/metrics"
|
"k8s.io/component-base/metrics"
|
||||||
"k8s.io/component-base/metrics/legacyregistry"
|
"k8s.io/component-base/metrics/legacyregistry"
|
||||||
)
|
)
|
||||||
@ -103,17 +101,17 @@ func RecordvSphereMetric(actionName string, requestTime time.Time, err error) {
|
|||||||
|
|
||||||
func recordvSphereAPIMetric(actionName string, requestTime time.Time, err error) {
|
func recordvSphereAPIMetric(actionName string, requestTime time.Time, err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
vsphereAPIErrorMetric.With(prometheus.Labels{"request": actionName}).Inc()
|
vsphereAPIErrorMetric.With(metrics.Labels{"request": actionName}).Inc()
|
||||||
} else {
|
} else {
|
||||||
vsphereAPIMetric.With(prometheus.Labels{"request": actionName}).Observe(calculateTimeTaken(requestTime))
|
vsphereAPIMetric.With(metrics.Labels{"request": actionName}).Observe(calculateTimeTaken(requestTime))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func recordvSphereOperationMetric(actionName string, requestTime time.Time, err error) {
|
func recordvSphereOperationMetric(actionName string, requestTime time.Time, err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
vsphereOperationErrorMetric.With(prometheus.Labels{"operation": actionName}).Inc()
|
vsphereOperationErrorMetric.With(metrics.Labels{"operation": actionName}).Inc()
|
||||||
} else {
|
} else {
|
||||||
vsphereOperationMetric.With(prometheus.Labels{"operation": actionName}).Observe(calculateTimeTaken(requestTime))
|
vsphereOperationMetric.With(metrics.Labels{"operation": actionName}).Observe(calculateTimeTaken(requestTime))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user