Skip to content

Commit

Permalink
Add node labels
Browse files Browse the repository at this point in the history
  • Loading branch information
weeco committed Mar 2, 2019
1 parent d2af95a commit 5f6aed3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions collector/container_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func init() {

func newContainerResourcesCollector(opts *options.Options) (Collector, error) {
subsystem := "pod_container_resource"
labels := []string{"pod", "container", "qos", "phase", "namespace"}
labels := []string{"pod", "container", "qos", "phase", "namespace", "node"}

return &containerResourcesCollector{
// Prometheus metrics
Expand Down Expand Up @@ -113,7 +113,7 @@ func (c *containerResourcesCollector) updateMetrics(ch chan<- prometheus.Metric)
for _, containerMetrics := range containerMetricses {
cm := *containerMetrics
log.Debugf("Test")
labelValues := []string{cm.Pod, cm.Container, cm.Qos, cm.Phase, cm.Namespace}
labelValues := []string{cm.Pod, cm.Container, cm.Qos, cm.Phase, cm.Namespace, cm.Node}
ch <- prometheus.MustNewConstMetric(c.requestCPUCoresDesc, prometheus.GaugeValue, cm.RequestCPUCores, labelValues...)
ch <- prometheus.MustNewConstMetric(c.requestMemoryBytesDesc, prometheus.GaugeValue, cm.RequestMemoryBytes, labelValues...)
ch <- prometheus.MustNewConstMetric(c.limitCPUCoresDesc, prometheus.GaugeValue, cm.LimitCPUCores, labelValues...)
Expand Down

0 comments on commit 5f6aed3

Please sign in to comment.