Skip to content

Commit cf9c76c

Browse files
committed
Merge pull request google#581 from juliusv/fix-metrics
Fix Prometheus metrics and typo in container info stats
2 parents 4da12aa + 661b174 commit cf9c76c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

info/v1/container.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ type LoadStats struct {
228228
NrStopped uint64 `json:"nr_stopped"`
229229

230230
// Number of tasks in uninterruptible state
231-
NrUinterruptible uint64 `json:"nr_uninterruptible"`
231+
NrUninterruptible uint64 `json:"nr_uninterruptible"`
232232

233233
// Number of tasks waiting on IO
234234
NrIoWait uint64 `json:"nr_io_wait"`

metrics/prometheus.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func NewPrometheusCollector(manager manager.Manager) *PrometheusCollector {
183183
nil),
184184
fsWeightedIoTime: prometheus.NewDesc(
185185
"container_fs_io_time_weighted_seconds_total",
186-
"Cumulative count of seconds spent doing I/Os",
186+
"Cumulative weighted I/O time in seconds",
187187
[]string{"name", "id", "device"},
188188
nil),
189189
networkRxBytes: prometheus.NewDesc(
@@ -198,7 +198,7 @@ func NewPrometheusCollector(manager manager.Manager) *PrometheusCollector {
198198
nil),
199199
networkRxDropped: prometheus.NewDesc(
200200
"container_network_receive_packets_dropped_total",
201-
"Cumulative count of bytes received",
201+
"Cumulative count of packets dropped while receiving",
202202
[]string{"name", "id"},
203203
nil),
204204
networkRxErrors: prometheus.NewDesc(
@@ -218,7 +218,7 @@ func NewPrometheusCollector(manager manager.Manager) *PrometheusCollector {
218218
nil),
219219
networkTxDropped: prometheus.NewDesc(
220220
"container_network_transmit_packets_dropped_total",
221-
"Cumulative count of bytes dropped",
221+
"Cumulative count of packets dropped while transmitting",
222222
[]string{"name", "id"},
223223
nil),
224224
networkTxErrors: prometheus.NewDesc(
@@ -311,7 +311,7 @@ func (c *PrometheusCollector) Collect(ch chan<- prometheus.Metric) {
311311
{valueType: prometheus.GaugeValue, labels: []string{"sleeping"}, value: float64(stats.TaskStats.NrSleeping)},
312312
{valueType: prometheus.GaugeValue, labels: []string{"running"}, value: float64(stats.TaskStats.NrRunning)},
313313
{valueType: prometheus.GaugeValue, labels: []string{"stopped"}, value: float64(stats.TaskStats.NrStopped)},
314-
{valueType: prometheus.GaugeValue, labels: []string{"uninterruptible"}, value: float64(stats.TaskStats.NrUinterruptible)},
314+
{valueType: prometheus.GaugeValue, labels: []string{"uninterruptible"}, value: float64(stats.TaskStats.NrUninterruptible)},
315315
{valueType: prometheus.GaugeValue, labels: []string{"iowaiting"}, value: float64(stats.TaskStats.NrIoWait)},
316316
},
317317

@@ -351,8 +351,8 @@ func (c *PrometheusCollector) Collect(ch chan<- prometheus.Metric) {
351351
c.fsWritesMerged: {valueType: prometheus.CounterValue, value: float64(stat.WritesMerged)},
352352
c.fsWriteTime: {valueType: prometheus.CounterValue, value: float64(stat.WriteTime) / float64(time.Second)},
353353

354-
c.fsIoTime: {valueType: prometheus.CounterValue, value: float64(stat.IoInProgress) / float64(time.Second)},
355-
c.fsWeightedIoTime: {valueType: prometheus.CounterValue, value: float64(stat.IoTime) / float64(time.Second)},
354+
c.fsIoTime: {valueType: prometheus.CounterValue, value: float64(stat.IoTime) / float64(time.Second)},
355+
c.fsWeightedIoTime: {valueType: prometheus.CounterValue, value: float64(stat.WeightedIoTime) / float64(time.Second)},
356356

357357
c.fsIoInProgress: {valueType: prometheus.GaugeValue, value: float64(stat.IoInProgress)},
358358
c.fsLimit: {valueType: prometheus.GaugeValue, value: float64(stat.Limit)},

0 commit comments

Comments
 (0)