From 4f015993860b80a5c19741ce4e504556fcd888e7 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Thu, 12 Mar 2015 21:57:16 +0100 Subject: [PATCH 1/2] Fix Prometheus metrics and docstrings. --- metrics/prometheus.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/metrics/prometheus.go b/metrics/prometheus.go index 37b5f950..fb300662 100644 --- a/metrics/prometheus.go +++ b/metrics/prometheus.go @@ -183,7 +183,7 @@ func NewPrometheusCollector(manager manager.Manager) *PrometheusCollector { nil), fsWeightedIoTime: prometheus.NewDesc( "container_fs_io_time_weighted_seconds_total", - "Cumulative count of seconds spent doing I/Os", + "Cumulative weighted I/O time in seconds", []string{"name", "id", "device"}, nil), networkRxBytes: prometheus.NewDesc( @@ -198,7 +198,7 @@ func NewPrometheusCollector(manager manager.Manager) *PrometheusCollector { nil), networkRxDropped: prometheus.NewDesc( "container_network_receive_packets_dropped_total", - "Cumulative count of bytes received", + "Cumulative count of packets dropped while receiving", []string{"name", "id"}, nil), networkRxErrors: prometheus.NewDesc( @@ -218,7 +218,7 @@ func NewPrometheusCollector(manager manager.Manager) *PrometheusCollector { nil), networkTxDropped: prometheus.NewDesc( "container_network_transmit_packets_dropped_total", - "Cumulative count of bytes dropped", + "Cumulative count of packets dropped while transmitting", []string{"name", "id"}, nil), networkTxErrors: prometheus.NewDesc( @@ -351,8 +351,8 @@ func (c *PrometheusCollector) Collect(ch chan<- prometheus.Metric) { c.fsWritesMerged: {valueType: prometheus.CounterValue, value: float64(stat.WritesMerged)}, c.fsWriteTime: {valueType: prometheus.CounterValue, value: float64(stat.WriteTime) / float64(time.Second)}, - c.fsIoTime: {valueType: prometheus.CounterValue, value: float64(stat.IoInProgress) / float64(time.Second)}, - c.fsWeightedIoTime: {valueType: prometheus.CounterValue, value: float64(stat.IoTime) / float64(time.Second)}, + c.fsIoTime: {valueType: prometheus.CounterValue, value: float64(stat.IoTime) / float64(time.Second)}, + c.fsWeightedIoTime: {valueType: prometheus.CounterValue, value: float64(stat.WeightedIoTime) / float64(time.Second)}, c.fsIoInProgress: {valueType: prometheus.GaugeValue, value: float64(stat.IoInProgress)}, c.fsLimit: {valueType: prometheus.GaugeValue, value: float64(stat.Limit)}, From 661b174c1db8eed07a331ca41628f3d0367693e4 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Thu, 12 Mar 2015 22:09:30 +0100 Subject: [PATCH 2/2] Fix Uinterruptible -> Uinterruptible typo. --- info/v1/container.go | 2 +- metrics/prometheus.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/info/v1/container.go b/info/v1/container.go index 2625626c..8f40d067 100644 --- a/info/v1/container.go +++ b/info/v1/container.go @@ -228,7 +228,7 @@ type LoadStats struct { NrStopped uint64 `json:"nr_stopped"` // Number of tasks in uninterruptible state - NrUinterruptible uint64 `json:"nr_uninterruptible"` + NrUninterruptible uint64 `json:"nr_uninterruptible"` // Number of tasks waiting on IO NrIoWait uint64 `json:"nr_io_wait"` diff --git a/metrics/prometheus.go b/metrics/prometheus.go index fb300662..c7805763 100644 --- a/metrics/prometheus.go +++ b/metrics/prometheus.go @@ -311,7 +311,7 @@ func (c *PrometheusCollector) Collect(ch chan<- prometheus.Metric) { {valueType: prometheus.GaugeValue, labels: []string{"sleeping"}, value: float64(stats.TaskStats.NrSleeping)}, {valueType: prometheus.GaugeValue, labels: []string{"running"}, value: float64(stats.TaskStats.NrRunning)}, {valueType: prometheus.GaugeValue, labels: []string{"stopped"}, value: float64(stats.TaskStats.NrStopped)}, - {valueType: prometheus.GaugeValue, labels: []string{"uninterruptible"}, value: float64(stats.TaskStats.NrUinterruptible)}, + {valueType: prometheus.GaugeValue, labels: []string{"uninterruptible"}, value: float64(stats.TaskStats.NrUninterruptible)}, {valueType: prometheus.GaugeValue, labels: []string{"iowaiting"}, value: float64(stats.TaskStats.NrIoWait)}, },