Skip to content

Commit

Permalink
fix(metric): Modify pvc namespace label name
Browse files Browse the repository at this point in the history
The label `namespace` will be used by the Prometheus collector.
Change it to `pvc_namespace`

Signed-off-by: James Lu <jamesluhz@gmail.com>
(cherry picked from commit b5e478d)
  • Loading branch information
mantissahz authored and David Ko committed Nov 13, 2023
1 parent f7685e5 commit 35b1637
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion metrics_collector/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (
managerLabel = "manager"
backupLabel = "backup"
pvcLabel = "pvc"
namespaceLabel = "namespace"
pvcNamespaceLabel = "pvc_namespace"
)

type metricInfo struct {
Expand Down
20 changes: 10 additions & 10 deletions metrics_collector/volume_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 35b1637

Please sign in to comment.