diff --git a/metrics_collector/types.go b/metrics_collector/types.go index 56fda4034c..d542a46ef6 100644 --- a/metrics_collector/types.go +++ b/metrics_collector/types.go @@ -26,7 +26,7 @@ const ( managerLabel = "manager" backupLabel = "backup" pvcLabel = "pvc" - namespaceLabel = "namespace" + pvcNamespaceLabel = "pvc_namespace" ) type metricInfo struct { diff --git a/metrics_collector/volume_collector.go b/metrics_collector/volume_collector.go index 2c8a0de069..93d25e075d 100644 --- a/metrics_collector/volume_collector.go +++ b/metrics_collector/volume_collector.go @@ -51,7 +51,7 @@ func NewVolumeCollector( Desc: prometheus.NewDesc( prometheus.BuildFQName(longhornName, subsystemVolume, "capacity_bytes"), "Configured size in bytes for this volume", - []string{nodeLabel, volumeLabel, pvcLabel, namespaceLabel}, + []string{nodeLabel, volumeLabel, pvcLabel, pvcNamespaceLabel}, nil, ), Type: prometheus.GaugeValue, @@ -61,7 +61,7 @@ func NewVolumeCollector( Desc: prometheus.NewDesc( prometheus.BuildFQName(longhornName, subsystemVolume, "actual_size_bytes"), "Actual space used by each replica of the volume on the corresponding node", - []string{nodeLabel, volumeLabel, pvcLabel, namespaceLabel}, + []string{nodeLabel, volumeLabel, pvcLabel, pvcNamespaceLabel}, nil, ), Type: prometheus.GaugeValue, @@ -71,7 +71,7 @@ func NewVolumeCollector( Desc: prometheus.NewDesc( prometheus.BuildFQName(longhornName, subsystemVolume, "state"), "State of this volume", - []string{nodeLabel, volumeLabel, pvcLabel, namespaceLabel}, + []string{nodeLabel, volumeLabel, pvcLabel, pvcNamespaceLabel}, nil, ), Type: prometheus.GaugeValue, @@ -81,7 +81,7 @@ func NewVolumeCollector( Desc: prometheus.NewDesc( prometheus.BuildFQName(longhornName, subsystemVolume, "robustness"), "Robustness of this volume", - []string{nodeLabel, volumeLabel, pvcLabel, namespaceLabel}, + []string{nodeLabel, volumeLabel, pvcLabel, pvcNamespaceLabel}, nil, ), Type: prometheus.GaugeValue, @@ -91,7 +91,7 @@ func NewVolumeCollector( Desc: prometheus.NewDesc( prometheus.BuildFQName(longhornName, subsystemVolume, "read_throughput"), "Read throughput of this volume (Bytes/s)", - []string{nodeLabel, volumeLabel, pvcLabel, namespaceLabel}, + []string{nodeLabel, volumeLabel, pvcLabel, pvcNamespaceLabel}, nil, ), Type: prometheus.GaugeValue, @@ -101,7 +101,7 @@ func NewVolumeCollector( Desc: prometheus.NewDesc( prometheus.BuildFQName(longhornName, subsystemVolume, "write_throughput"), "Write throughput of this volume (Bytes/s)", - []string{nodeLabel, volumeLabel, pvcLabel, namespaceLabel}, + []string{nodeLabel, volumeLabel, pvcLabel, pvcNamespaceLabel}, nil, ), Type: prometheus.GaugeValue, @@ -111,7 +111,7 @@ func NewVolumeCollector( Desc: prometheus.NewDesc( prometheus.BuildFQName(longhornName, subsystemVolume, "read_iops"), "Read IOPS of this volume", - []string{nodeLabel, volumeLabel, pvcLabel, namespaceLabel}, + []string{nodeLabel, volumeLabel, pvcLabel, pvcNamespaceLabel}, nil, ), Type: prometheus.GaugeValue, @@ -121,7 +121,7 @@ func NewVolumeCollector( Desc: prometheus.NewDesc( prometheus.BuildFQName(longhornName, subsystemVolume, "write_iops"), "Write IOPS of this volume", - []string{nodeLabel, volumeLabel, pvcLabel, namespaceLabel}, + []string{nodeLabel, volumeLabel, pvcLabel, pvcNamespaceLabel}, nil, ), Type: prometheus.GaugeValue, @@ -131,7 +131,7 @@ func NewVolumeCollector( Desc: prometheus.NewDesc( prometheus.BuildFQName(longhornName, subsystemVolume, "read_latency"), "Read latency of this volume (ns)", - []string{nodeLabel, volumeLabel, pvcLabel, namespaceLabel}, + []string{nodeLabel, volumeLabel, pvcLabel, pvcNamespaceLabel}, nil, ), Type: prometheus.GaugeValue, @@ -141,7 +141,7 @@ func NewVolumeCollector( Desc: prometheus.NewDesc( prometheus.BuildFQName(longhornName, subsystemVolume, "write_latency"), "Write latency of this volume (ns)", - []string{nodeLabel, volumeLabel, pvcLabel, namespaceLabel}, + []string{nodeLabel, volumeLabel, pvcLabel, pvcNamespaceLabel}, nil, ), Type: prometheus.GaugeValue,