mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Merge pull request #83279 from RainbowMango/pr_remove_direct_reference_to_prometheus_from_kubelet
Remove direct reference to prometheus from kubelet
This commit is contained in:
commit
d73b0d0438
@ -35,7 +35,6 @@ go_library(
|
|||||||
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
|
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
|
||||||
"//staging/src/k8s.io/client-go/tools/record:go_default_library",
|
"//staging/src/k8s.io/client-go/tools/record:go_default_library",
|
||||||
"//staging/src/k8s.io/component-base/metrics:go_default_library",
|
"//staging/src/k8s.io/component-base/metrics:go_default_library",
|
||||||
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
|
|
||||||
"//vendor/k8s.io/klog:go_default_library",
|
"//vendor/k8s.io/klog:go_default_library",
|
||||||
"//vendor/k8s.io/utils/exec:go_default_library",
|
"//vendor/k8s.io/utils/exec:go_default_library",
|
||||||
],
|
],
|
||||||
|
@ -20,9 +20,9 @@ import (
|
|||||||
"math/rand"
|
"math/rand"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
|
||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/runtime"
|
"k8s.io/apimachinery/pkg/util/runtime"
|
||||||
|
"k8s.io/component-base/metrics"
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
|
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
|
||||||
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
|
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
|
||||||
@ -69,9 +69,9 @@ type worker struct {
|
|||||||
|
|
||||||
// proberResultsMetricLabels holds the labels attached to this worker
|
// proberResultsMetricLabels holds the labels attached to this worker
|
||||||
// for the ProberResults metric by result.
|
// for the ProberResults metric by result.
|
||||||
proberResultsSuccessfulMetricLabels prometheus.Labels
|
proberResultsSuccessfulMetricLabels metrics.Labels
|
||||||
proberResultsFailedMetricLabels prometheus.Labels
|
proberResultsFailedMetricLabels metrics.Labels
|
||||||
proberResultsUnknownMetricLabels prometheus.Labels
|
proberResultsUnknownMetricLabels metrics.Labels
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creates and starts a new probe worker.
|
// Creates and starts a new probe worker.
|
||||||
@ -104,7 +104,7 @@ func newWorker(
|
|||||||
w.initialValue = results.Failure
|
w.initialValue = results.Failure
|
||||||
}
|
}
|
||||||
|
|
||||||
basicMetricLabels := prometheus.Labels{
|
basicMetricLabels := metrics.Labels{
|
||||||
"probe_type": w.probeType.String(),
|
"probe_type": w.probeType.String(),
|
||||||
"container": w.container.Name,
|
"container": w.container.Name,
|
||||||
"pod": w.pod.Name,
|
"pod": w.pod.Name,
|
||||||
@ -284,8 +284,8 @@ func (w *worker) doProbe() (keepGoing bool) {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func deepCopyPrometheusLabels(m prometheus.Labels) prometheus.Labels {
|
func deepCopyPrometheusLabels(m metrics.Labels) metrics.Labels {
|
||||||
ret := make(prometheus.Labels, len(m))
|
ret := make(metrics.Labels, len(m))
|
||||||
for k, v := range m {
|
for k, v := range m {
|
||||||
ret[k] = v
|
ret[k] = v
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user