@@ -23,6 +23,7 @@ import (
23
23
"github.com/google/cadvisor/container"
24
24
info "github.com/google/cadvisor/info/v1"
25
25
v2 "github.com/google/cadvisor/info/v2"
26
+ "github.com/opencontainers/runc/libcontainer/cgroups"
26
27
27
28
"github.com/prometheus/client_golang/prometheus"
28
29
@@ -398,6 +399,42 @@ func NewPrometheusCollector(i infoProvider, f ContainerLabelsFunc, includedMetri
398
399
getValues : func (s * info.ContainerStats ) metricValues {
399
400
return metricValues {{value : float64 (s .Memory .MappedFile ), timestamp : s .Timestamp }}
400
401
},
402
+ }, {
403
+ name : "container_memory_shmem" ,
404
+ help : "Size of shmem in bytes." ,
405
+ valueType : prometheus .GaugeValue ,
406
+ getValues : func (s * info.ContainerStats ) metricValues {
407
+ return metricValues {{value : float64 (s .Memory .Shmem ), timestamp : s .Timestamp }}
408
+ },
409
+ }, {
410
+ name : "container_memory_dirty" ,
411
+ help : "Size of memory that are waiting to get written back to the disk in bytes." ,
412
+ valueType : prometheus .GaugeValue ,
413
+ getValues : func (s * info.ContainerStats ) metricValues {
414
+ return metricValues {{value : float64 (s .Memory .Dirty ), timestamp : s .Timestamp }}
415
+ },
416
+ }, {
417
+ name : "container_memory_writeback" ,
418
+ help : "Size of file/anon cache that are queued for syncing to disk in bytes." ,
419
+ valueType : prometheus .GaugeValue ,
420
+ getValues : func (s * info.ContainerStats ) metricValues {
421
+ return metricValues {{value : float64 (s .Memory .Writeback ), timestamp : s .Timestamp }}
422
+ },
423
+ }, {
424
+ name : "container_memory_unevictable" ,
425
+ help : "Size of unevictable memory in bytes." ,
426
+ valueType : prometheus .GaugeValue ,
427
+ getValues : func (s * info.ContainerStats ) metricValues {
428
+ return metricValues {{value : float64 (s .Memory .Unevictable ), timestamp : s .Timestamp }}
429
+ },
430
+ }, {
431
+ name : "container_memory_sock" ,
432
+ help : "Size of memory used in network transmission buffers in bytes." ,
433
+ valueType : prometheus .GaugeValue ,
434
+ condition : func (s info.ContainerSpec ) bool { return cgroups .IsCgroup2UnifiedMode () },
435
+ getValues : func (s * info.ContainerStats ) metricValues {
436
+ return metricValues {{value : float64 (s .Memory .Sock ), timestamp : s .Timestamp }}
437
+ },
401
438
}, {
402
439
name : "container_memory_swap" ,
403
440
help : "Container swap usage in bytes." ,
0 commit comments