mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #4906 from vmarmol/mon-containers-per-pod
Adding ContainersPerPodCount metric.
This commit is contained in:
commit
53f7534a0a
@ -1306,6 +1306,11 @@ func (kl *Kubelet) SyncPods(pods []api.BoundPod, podSyncTypes map[types.UID]metr
|
||||
kl.podWorkers.UpdatePod(pod, func() {
|
||||
metrics.SyncPodLatency.WithLabelValues(podSyncTypes[pod.UID].String()).Observe(metrics.SinceInMicroseconds(start))
|
||||
})
|
||||
|
||||
// Note the number of containers for new pods.
|
||||
if val, ok := podSyncTypes[pod.UID]; ok && (val == metrics.SyncPodCreate) {
|
||||
metrics.ContainersPerPodCount.Observe(float64(len(pod.Spec.Containers)))
|
||||
}
|
||||
}
|
||||
|
||||
// Stop the workers for no-longer existing pods.
|
||||
|
@ -36,7 +36,13 @@ var (
|
||||
Help: "Image pull latency in microseconds.",
|
||||
},
|
||||
)
|
||||
// TODO(vmarmol): Break down by number of containers in pod?
|
||||
ContainersPerPodCount = prometheus.NewSummary(
|
||||
prometheus.SummaryOpts{
|
||||
Subsystem: kubeletSubsystem,
|
||||
Name: "containers_per_pod_count",
|
||||
Help: "The number of containers per pod.",
|
||||
},
|
||||
)
|
||||
SyncPodLatency = prometheus.NewSummaryVec(
|
||||
prometheus.SummaryOpts{
|
||||
Subsystem: kubeletSubsystem,
|
||||
@ -52,7 +58,6 @@ var (
|
||||
Help: "Latency in microseconds to sync all pods.",
|
||||
},
|
||||
)
|
||||
// TODO(vmarmol): Containers per pod
|
||||
DockerOperationsLatency = prometheus.NewSummaryVec(
|
||||
prometheus.SummaryOpts{
|
||||
Subsystem: kubeletSubsystem,
|
||||
@ -73,6 +78,7 @@ func Register(containerCache dockertools.DockerCache) {
|
||||
prometheus.MustRegister(SyncPodLatency)
|
||||
prometheus.MustRegister(DockerOperationsLatency)
|
||||
prometheus.MustRegister(SyncPodsLatency)
|
||||
prometheus.MustRegister(ContainersPerPodCount)
|
||||
prometheus.MustRegister(newPodAndContainerCollector(containerCache))
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user