Skip to content

Commit 621d844

Browse files
committed
Add additional labels to mount operation metric
1 parent aedf006 commit 621d844

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/gce-pd-csi-driver/node.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ func (ns *GCENodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStage
449449
}
450450

451451
if ns.metricsManager != nil {
452-
ns.metricsManager.RecordMountErrorMetric(err)
452+
ns.metricsManager.RecordMountErrorMetric(fstype, err)
453453
}
454454
return nil, status.Error(codes.Internal,
455455
fmt.Sprintf("Failed to format and mount device from (%q) to (%q) with fstype (%q) and options (%q): %v",

pkg/metrics/metrics.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var (
6161
Help: "Node server file system mounting errors",
6262
StabilityLevel: metrics.ALPHA,
6363
},
64-
[]string{"error_type"},
64+
[]string{"driver_name", "files_system_format", "error_type"},
6565
)
6666
)
6767

@@ -115,10 +115,10 @@ func (mm *MetricsManager) RecordOperationErrorMetrics(
115115
klog.Infof("Recorded PDCSI operation error code: %q", errCode)
116116
}
117117

118-
func (mm *MetricsManager) RecordMountErrorMetric(err error) {
118+
func (mm *MetricsManager) RecordMountErrorMetric(fs_format string, err error) {
119119
mntErr := &mount.MountError{}
120120
if errors.As(err, mntErr) {
121-
mountErrorMetric.WithLabelValues(string(mntErr.Type)).Inc()
121+
mountErrorMetric.WithLabelValues(pdcsiDriverName, fs_format, string(mntErr.Type)).Inc()
122122
}
123123

124124
klog.Infof("Recorded mount error type: %q", mntErr.Type)

0 commit comments

Comments
 (0)