@@ -77,13 +77,14 @@ func collectMetrics(w http.ResponseWriter, r *http.Request) {
77
77
log .Printf ("Found %d containers" , len (containers .Containers ))
78
78
containerMap := make (map [string ]containerInfo )
79
79
for _ , container := range containers .GetContainers () {
80
+ log .Printf ("Found container %s" , container .GetId ())
80
81
containerMap [container .Id ] = containerInfo {
81
82
Node : node ,
82
83
Namespace : container .Labels ["io.kubernetes.pod.namespace" ],
83
84
Pod : container .Labels ["io.kubernetes.pod.name" ],
84
85
PodUid : container .Labels ["io.kubernetes.pod.uid" ],
85
86
Container : container .Metadata .Name ,
86
- ContainerId : container .Id ,
87
+ ContainerId : container .GetId () ,
87
88
}
88
89
}
89
90
collected := []metric {}
@@ -95,7 +96,7 @@ func collectMetrics(w http.ResponseWriter, r *http.Request) {
95
96
log .Printf ("Found %d processes on GPU %d" , len (processes ), i )
96
97
for _ , process := range processes {
97
98
containerId := getContainerId (process .Pid )
98
- container := containerMap [containerId ]
99
+ container := containerMap [containerId [: 13 ] ]
99
100
collected = append (collected , metric {
100
101
Pid : process .Pid ,
101
102
UsedGpuMemory : process .UsedGpuMemory ,
0 commit comments