@@ -42,13 +42,18 @@ var (
4242
4343 imagePulls metrics.LabeledCounter
4444 inProgressImagePulls metrics.Gauge
45- // pull duration / ( image size / 1MBi)
45+ // image size in MB / image pull duration in seconds
4646 imagePullThroughput prom.Histogram
4747)
4848
4949func init () {
50+ const (
51+ namespace = "containerd"
52+ subsystem = "cri_sandboxed"
53+ )
54+
5055 // these CRI metrics record latencies for successful operations around a sandbox and container's lifecycle.
51- ns := metrics .NewNamespace ("containerd" , "cri_sandboxed" , nil )
56+ ns := metrics .NewNamespace (namespace , subsystem , nil )
5257
5358 sandboxListTimer = ns .NewTimer ("sandbox_list" , "time to list sandboxes" )
5459 sandboxCreateNetworkTimer = ns .NewTimer ("sandbox_create_network" , "time to create the network for a sandbox" )
@@ -72,12 +77,14 @@ func init() {
7277 inProgressImagePulls = ns .NewGauge ("in_progress_image_pulls" , "in progress pulls" , metrics .Total )
7378 imagePullThroughput = prom .NewHistogram (
7479 prom.HistogramOpts {
75- Name : "image_pulling_throughput" ,
76- Help : "image pull throughput" ,
77- Buckets : prom .DefBuckets ,
80+ Namespace : namespace ,
81+ Subsystem : subsystem ,
82+ Name : "image_pulling_throughput" ,
83+ Help : "image pull throughput" ,
84+ Buckets : prom .DefBuckets ,
7885 },
7986 )
80-
87+ ns . Add ( imagePullThroughput )
8188 metrics .Register (ns )
8289}
8390
0 commit comments