@@ -77,13 +77,13 @@ 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 () )
81
- containerMap [container .Id ] = containerInfo {
80
+ log .Printf ("Found container %+v " , container )
81
+ containerMap [container .GetId () ] = containerInfo {
82
82
Node : node ,
83
- Namespace : container .Labels ["io.kubernetes.pod.namespace" ],
84
- Pod : container .Labels ["io.kubernetes.pod.name" ],
85
- PodUid : container .Labels ["io.kubernetes.pod.uid" ],
86
- Container : container .Metadata . Name ,
83
+ Namespace : container .GetLabels () ["io.kubernetes.pod.namespace" ],
84
+ Pod : container .GetLabels () ["io.kubernetes.pod.name" ],
85
+ PodUid : container .GetLabels () ["io.kubernetes.pod.uid" ],
86
+ Container : container .GetMetadata (). GetName () ,
87
87
ContainerId : container .GetId (),
88
88
}
89
89
}
@@ -96,7 +96,8 @@ func collectMetrics(w http.ResponseWriter, r *http.Request) {
96
96
log .Printf ("Found %d processes on GPU %d" , len (processes ), i )
97
97
for _ , process := range processes {
98
98
containerId := getContainerId (process .Pid )
99
- container := containerMap [containerId [:13 ]]
99
+ container := containerMap [containerId ]
100
+ log .Printf ("Found container %+v for process: %d" , container , process .Pid )
100
101
collected = append (collected , metric {
101
102
Pid : process .Pid ,
102
103
UsedGpuMemory : process .UsedGpuMemory ,
0 commit comments