Skip to content

Commit ff7cfd2

Browse files
Merge pull request #1762 from huww98/fix/grpc-metric-type-label
fix: restore short driver type in metric labels
2 parents 69b268d + a180c8c commit ff7cfd2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ func main() {
275275
klog.Fatalf("CSI start failed, not support driver: %s", driverName)
276276
}
277277

278-
server := common.NewCSIServer(driverName, driver)
278+
// The metric "type" label uses the short driver type (e.g. "disk", "bmcpfs").
279+
driverType := strings.TrimSuffix(driverName, TypePluginSuffix)
280+
server := common.NewCSIServer(driverType, driver)
279281
wg.Go(func() {
280282
common.Serve(server, endpoint)
281283
})

0 commit comments

Comments
 (0)