mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
Merge pull request #97006 from lingsamuel/fix-cadvisor-machine-metrics
Fix missing cadvisor machine metrics
This commit is contained in:
commit
75115236e7
@ -551,6 +551,9 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
// Avoid collector collects it as a timestamped metric
|
||||||
|
// See PR #95210 and #97006 for more details.
|
||||||
|
machineInfo.Timestamp = time.Time{}
|
||||||
klet.setCachedMachineInfo(machineInfo)
|
klet.setCachedMachineInfo(machineInfo)
|
||||||
|
|
||||||
imageBackOff := flowcontrol.NewBackOff(backOffPeriod, MaxContainerBackOff)
|
imageBackOff := flowcontrol.NewBackOff(backOffPeriod, MaxContainerBackOff)
|
||||||
|
@ -367,6 +367,7 @@ func (s *Server) InstallDefaultHandlers(enableCAdvisorJSONEndpoints bool) {
|
|||||||
Recursive: true,
|
Recursive: true,
|
||||||
}
|
}
|
||||||
r.RawMustRegister(metrics.NewPrometheusCollector(prometheusHostAdapter{s.host}, containerPrometheusLabelsFunc(s.host), includedMetrics, clock.RealClock{}, cadvisorOpts))
|
r.RawMustRegister(metrics.NewPrometheusCollector(prometheusHostAdapter{s.host}, containerPrometheusLabelsFunc(s.host), includedMetrics, clock.RealClock{}, cadvisorOpts))
|
||||||
|
r.RawMustRegister(metrics.NewPrometheusMachineCollector(prometheusHostAdapter{s.host}, includedMetrics))
|
||||||
s.restfulCont.Handle(cadvisorMetricsPath,
|
s.restfulCont.Handle(cadvisorMetricsPath,
|
||||||
compbasemetrics.HandlerFor(r, compbasemetrics.HandlerOpts{ErrorHandling: compbasemetrics.ContinueOnError}),
|
compbasemetrics.HandlerFor(r, compbasemetrics.HandlerOpts{ErrorHandling: compbasemetrics.ContinueOnError}),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user