Deprecated metrics under /metrics/resource/v1alpha1
This commit is contained in:
parent
0db7074e1a
commit
ecf5f7d749
@ -24,6 +24,11 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/kubelet/server/stats"
|
"k8s.io/kubernetes/pkg/kubelet/server/stats"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// This file contains a series of deprecated metrics which we emit them by endpoint `/metrics/resource/v1alpha1`.
|
||||||
|
// These metrics have been adapted to new endpoint `/metrics/resource` as well as new `Desc`s.
|
||||||
|
// In general, we don't need to maintain these deprecated metrics any more.
|
||||||
|
// TODO(RainbowMango): Remove this file in release 1.20.0+.
|
||||||
|
|
||||||
// Version is the string representation of the version of this configuration
|
// Version is the string representation of the version of this configuration
|
||||||
const Version = "v1alpha1"
|
const Version = "v1alpha1"
|
||||||
|
|
||||||
@ -33,28 +38,28 @@ var (
|
|||||||
nil,
|
nil,
|
||||||
nil,
|
nil,
|
||||||
metrics.ALPHA,
|
metrics.ALPHA,
|
||||||
"")
|
"1.18.0")
|
||||||
|
|
||||||
nodeMemoryUsageDesc = metrics.NewDesc("node_memory_working_set_bytes",
|
nodeMemoryUsageDesc = metrics.NewDesc("node_memory_working_set_bytes",
|
||||||
"Current working set of the node in bytes",
|
"Current working set of the node in bytes",
|
||||||
nil,
|
nil,
|
||||||
nil,
|
nil,
|
||||||
metrics.ALPHA,
|
metrics.ALPHA,
|
||||||
"")
|
"1.18.0")
|
||||||
|
|
||||||
containerCPUUsageDesc = metrics.NewDesc("container_cpu_usage_seconds_total",
|
containerCPUUsageDesc = metrics.NewDesc("container_cpu_usage_seconds_total",
|
||||||
"Cumulative cpu time consumed by the container in core-seconds",
|
"Cumulative cpu time consumed by the container in core-seconds",
|
||||||
[]string{"container", "pod", "namespace"},
|
[]string{"container", "pod", "namespace"},
|
||||||
nil,
|
nil,
|
||||||
metrics.ALPHA,
|
metrics.ALPHA,
|
||||||
"")
|
"1.18.0")
|
||||||
|
|
||||||
containerMemoryUsageDesc = metrics.NewDesc("container_memory_working_set_bytes",
|
containerMemoryUsageDesc = metrics.NewDesc("container_memory_working_set_bytes",
|
||||||
"Current working set of the container in bytes",
|
"Current working set of the container in bytes",
|
||||||
[]string{"container", "pod", "namespace"},
|
[]string{"container", "pod", "namespace"},
|
||||||
nil,
|
nil,
|
||||||
metrics.ALPHA,
|
metrics.ALPHA,
|
||||||
"")
|
"1.18.0")
|
||||||
)
|
)
|
||||||
|
|
||||||
// getNodeCPUMetrics returns CPU utilization of a node.
|
// getNodeCPUMetrics returns CPU utilization of a node.
|
||||||
|
@ -320,6 +320,7 @@ func (s *Server) InstallDefaultHandlers(enableCAdvisorJSONEndpoints bool) {
|
|||||||
compbasemetrics.HandlerFor(r, compbasemetrics.HandlerOpts{ErrorHandling: compbasemetrics.ContinueOnError}),
|
compbasemetrics.HandlerFor(r, compbasemetrics.HandlerOpts{ErrorHandling: compbasemetrics.ContinueOnError}),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// deprecated endpoint which will be removed in release 1.20.0+.
|
||||||
v1alpha1ResourceRegistry := compbasemetrics.NewKubeRegistry()
|
v1alpha1ResourceRegistry := compbasemetrics.NewKubeRegistry()
|
||||||
v1alpha1ResourceRegistry.CustomMustRegister(stats.NewPrometheusResourceMetricCollector(s.resourceAnalyzer, v1alpha1.Config()))
|
v1alpha1ResourceRegistry.CustomMustRegister(stats.NewPrometheusResourceMetricCollector(s.resourceAnalyzer, v1alpha1.Config()))
|
||||||
s.restfulCont.Handle(path.Join(resourceMetricsPath, v1alpha1.Version),
|
s.restfulCont.Handle(path.Join(resourceMetricsPath, v1alpha1.Version),
|
||||||
|
@ -60,7 +60,7 @@ func NewPrometheusResourceMetricCollector(provider SummaryProvider, config Resou
|
|||||||
nil,
|
nil,
|
||||||
nil,
|
nil,
|
||||||
metrics.ALPHA,
|
metrics.ALPHA,
|
||||||
""),
|
"1.18.0"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user