mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Merge pull request #46211 from gmarek/panic
Automatic merge from submit-queue (batch tested with PRs 46133, 46211, 46224, 46205, 45910) Add more logs to kubelet_stats Ref. #46198
This commit is contained in:
commit
0329e3fdaf
@ -28,16 +28,19 @@ import (
|
|||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/prometheus/common/model"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
|
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
|
||||||
stats "k8s.io/kubernetes/pkg/kubelet/apis/stats/v1alpha1"
|
stats "k8s.io/kubernetes/pkg/kubelet/apis/stats/v1alpha1"
|
||||||
kubeletmetrics "k8s.io/kubernetes/pkg/kubelet/metrics"
|
kubeletmetrics "k8s.io/kubernetes/pkg/kubelet/metrics"
|
||||||
"k8s.io/kubernetes/pkg/master/ports"
|
"k8s.io/kubernetes/pkg/master/ports"
|
||||||
"k8s.io/kubernetes/pkg/metrics"
|
"k8s.io/kubernetes/pkg/metrics"
|
||||||
|
|
||||||
|
"github.com/golang/glog"
|
||||||
|
"github.com/prometheus/common/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
// KubeletMetric stores metrics scraped from the kubelet server's /metric endpoint.
|
// KubeletMetric stores metrics scraped from the kubelet server's /metric endpoint.
|
||||||
@ -367,6 +370,11 @@ func getOneTimeResourceUsageOnNode(
|
|||||||
}
|
}
|
||||||
|
|
||||||
f := func(name string, newStats *stats.ContainerStats) *ContainerResourceUsage {
|
f := func(name string, newStats *stats.ContainerStats) *ContainerResourceUsage {
|
||||||
|
// TODO(gmarek): remove when #46198 is debugged.
|
||||||
|
if newStats == nil || newStats.CPU == nil {
|
||||||
|
glog.Warning("NewStats is %#v for container %v", newStats, name)
|
||||||
|
return &ContainerResourceUsage{}
|
||||||
|
}
|
||||||
return &ContainerResourceUsage{
|
return &ContainerResourceUsage{
|
||||||
Name: name,
|
Name: name,
|
||||||
Timestamp: newStats.StartTime.Time,
|
Timestamp: newStats.StartTime.Time,
|
||||||
|
Loading…
Reference in New Issue
Block a user