From 69996739a50af9f389c2bb7bfab82028358ca8d6 Mon Sep 17 00:00:00 2001 From: Antonin Ferrand Date: Fri, 10 Nov 2023 23:24:18 +0100 Subject: [PATCH 1/3] style(negative): linter Signed-off-by: Antonin Ferrand --- .../v1.6.0/test-pvc-name-included-in-volume-metrics.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/content/manual/release-specific/v1.6.0/test-pvc-name-included-in-volume-metrics.md b/docs/content/manual/release-specific/v1.6.0/test-pvc-name-included-in-volume-metrics.md index 340474634b..7f2c236f07 100644 --- a/docs/content/manual/release-specific/v1.6.0/test-pvc-name-included-in-volume-metrics.md +++ b/docs/content/manual/release-specific/v1.6.0/test-pvc-name-included-in-volume-metrics.md @@ -3,16 +3,18 @@ title: Test PVC Name included in the volume metrics --- ## Related issue + https://github.com/longhorn/longhorn/issues/5297 ## Test step **Given** created 2 volumes (volume-1, volume-2) -**When** PVC created for volume (volume-1) +**When** PVC created for volume (volume-1) And attached volumes (volume-1, volume-2) **Then** metrics with `longhorn_volume_` prefix should include `pvc="volume-1"` + ```bash curl -sSL http://10.0.2.212:32744/metrics | grep longhorn_volume | grep ip-10-0-2-151 | grep volume-1 longhorn_volume_actual_size_bytes{node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 @@ -26,7 +28,9 @@ longhorn_volume_write_iops{node="ip-10-0-2-151",pvc="volume-1",volume="volume-1" longhorn_volume_write_latency{node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 longhorn_volume_write_throughput{node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 ``` + And metrics with `longhorn_volume_` prefix should include `pvc=""` for (volume-2) + ```bash > curl -sSL http://10.0.2.212:32744/metrics | grep longhorn_volume | grep ip-10-0-2-151 | grep volume-2 longhorn_volume_actual_size_bytes{node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 @@ -39,4 +43,4 @@ longhorn_volume_state{node="ip-10-0-2-151",pvc="",volume="volume-2"} 2 longhorn_volume_write_iops{node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 longhorn_volume_write_latency{node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 longhorn_volume_write_throughput{node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 -``` \ No newline at end of file +``` From 7044532140a03fe7295a0f0747c1554cb2df569b Mon Sep 17 00:00:00 2001 From: Antonin Ferrand Date: Sat, 11 Nov 2023 06:46:22 +0100 Subject: [PATCH 2/3] test(metrics): pvc namespace included in volume metrics Signed-off-by: Antonin Ferrand --- ...nd-namespace-included-in-volume-metrics.md | 47 +++++++++++++++++++ ...est-pvc-name-included-in-volume-metrics.md | 46 ------------------ 2 files changed, 47 insertions(+), 46 deletions(-) create mode 100644 docs/content/manual/release-specific/v1.6.0/test-pvc-name-and-namespace-included-in-volume-metrics.md delete mode 100644 docs/content/manual/release-specific/v1.6.0/test-pvc-name-included-in-volume-metrics.md diff --git a/docs/content/manual/release-specific/v1.6.0/test-pvc-name-and-namespace-included-in-volume-metrics.md b/docs/content/manual/release-specific/v1.6.0/test-pvc-name-and-namespace-included-in-volume-metrics.md new file mode 100644 index 0000000000..fe0074ae70 --- /dev/null +++ b/docs/content/manual/release-specific/v1.6.0/test-pvc-name-and-namespace-included-in-volume-metrics.md @@ -0,0 +1,47 @@ +--- +title: Test PVC Name and Namespace included in the volume metrics +--- + +## Related issues + +- https://github.com/longhorn/longhorn/issues/5297 +- https://github.com/longhorn/longhorn-manager/pull/2284 + +## Test step + +**Given** created 2 volumes (volume-1, volume-2) + +**When** PVC created for volume (volume-1) +And attached volumes (volume-1, volume-2) + +**Then** metrics with `longhorn_volume_` prefix should include `pvc="volume-1"` + +```bash +curl -sSL http://10.0.2.212:32744/metrics | grep longhorn_volume | grep ip-10-0-2-151 | grep volume-1 +longhorn_volume_actual_size_bytes{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 +longhorn_volume_capacity_bytes{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 1.073741824e+09 +longhorn_volume_read_iops{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 +longhorn_volume_read_latency{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 +longhorn_volume_read_throughput{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 +longhorn_volume_robustness{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 1 +longhorn_volume_state{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 2 +longhorn_volume_write_iops{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 +longhorn_volume_write_latency{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 +longhorn_volume_write_throughput{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 +``` + +And metrics with `longhorn_volume_` prefix should include `pvc=""` for (volume-2) + +```bash +> curl -sSL http://10.0.2.212:32744/metrics | grep longhorn_volume | grep ip-10-0-2-151 | grep volume-2 +longhorn_volume_actual_size_bytes{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 +longhorn_volume_capacity_bytes{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 1.073741824e+09 +longhorn_volume_read_iops{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 +longhorn_volume_read_latency{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 +longhorn_volume_read_throughput{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 +longhorn_volume_robustness{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 1 +longhorn_volume_state{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 2 +longhorn_volume_write_iops{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 +longhorn_volume_write_latency{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 +longhorn_volume_write_throughput{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 +``` diff --git a/docs/content/manual/release-specific/v1.6.0/test-pvc-name-included-in-volume-metrics.md b/docs/content/manual/release-specific/v1.6.0/test-pvc-name-included-in-volume-metrics.md deleted file mode 100644 index 7f2c236f07..0000000000 --- a/docs/content/manual/release-specific/v1.6.0/test-pvc-name-included-in-volume-metrics.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Test PVC Name included in the volume metrics ---- - -## Related issue - -https://github.com/longhorn/longhorn/issues/5297 - -## Test step - -**Given** created 2 volumes (volume-1, volume-2) - -**When** PVC created for volume (volume-1) -And attached volumes (volume-1, volume-2) - -**Then** metrics with `longhorn_volume_` prefix should include `pvc="volume-1"` - -```bash -curl -sSL http://10.0.2.212:32744/metrics | grep longhorn_volume | grep ip-10-0-2-151 | grep volume-1 -longhorn_volume_actual_size_bytes{node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 -longhorn_volume_capacity_bytes{node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 1.073741824e+09 -longhorn_volume_read_iops{node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 -longhorn_volume_read_latency{node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 -longhorn_volume_read_throughput{node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 -longhorn_volume_robustness{node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 1 -longhorn_volume_state{node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 2 -longhorn_volume_write_iops{node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 -longhorn_volume_write_latency{node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 -longhorn_volume_write_throughput{node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 -``` - -And metrics with `longhorn_volume_` prefix should include `pvc=""` for (volume-2) - -```bash -> curl -sSL http://10.0.2.212:32744/metrics | grep longhorn_volume | grep ip-10-0-2-151 | grep volume-2 -longhorn_volume_actual_size_bytes{node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 -longhorn_volume_capacity_bytes{node="ip-10-0-2-151",pvc="",volume="volume-2"} 1.073741824e+09 -longhorn_volume_read_iops{node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 -longhorn_volume_read_latency{node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 -longhorn_volume_read_throughput{node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 -longhorn_volume_robustness{node="ip-10-0-2-151",pvc="",volume="volume-2"} 1 -longhorn_volume_state{node="ip-10-0-2-151",pvc="",volume="volume-2"} 2 -longhorn_volume_write_iops{node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 -longhorn_volume_write_latency{node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 -longhorn_volume_write_throughput{node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 -``` From 896f1f07a15bbf4f45ff1e4a790c3ee7bcec67bf Mon Sep 17 00:00:00 2001 From: Antonin Ferrand Date: Mon, 13 Nov 2023 08:21:12 +0100 Subject: [PATCH 3/3] fix(metrics): pvc_namespace instead of namespace Signed-off-by: Antonin Ferrand --- ...nd-namespace-included-in-volume-metrics.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/content/manual/release-specific/v1.6.0/test-pvc-name-and-namespace-included-in-volume-metrics.md b/docs/content/manual/release-specific/v1.6.0/test-pvc-name-and-namespace-included-in-volume-metrics.md index fe0074ae70..850c8ea8db 100644 --- a/docs/content/manual/release-specific/v1.6.0/test-pvc-name-and-namespace-included-in-volume-metrics.md +++ b/docs/content/manual/release-specific/v1.6.0/test-pvc-name-and-namespace-included-in-volume-metrics.md @@ -18,30 +18,30 @@ And attached volumes (volume-1, volume-2) ```bash curl -sSL http://10.0.2.212:32744/metrics | grep longhorn_volume | grep ip-10-0-2-151 | grep volume-1 -longhorn_volume_actual_size_bytes{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 -longhorn_volume_capacity_bytes{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 1.073741824e+09 -longhorn_volume_read_iops{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 -longhorn_volume_read_latency{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 -longhorn_volume_read_throughput{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 -longhorn_volume_robustness{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 1 -longhorn_volume_state{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 2 -longhorn_volume_write_iops{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 -longhorn_volume_write_latency{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 -longhorn_volume_write_throughput{namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 +longhorn_volume_actual_size_bytes{pvc_namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 +longhorn_volume_capacity_bytes{pvc_namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 1.073741824e+09 +longhorn_volume_read_iops{pvc_namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 +longhorn_volume_read_latency{pvc_namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 +longhorn_volume_read_throughput{pvc_namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 +longhorn_volume_robustness{pvc_namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 1 +longhorn_volume_state{pvc_namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 2 +longhorn_volume_write_iops{pvc_namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 +longhorn_volume_write_latency{pvc_namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 +longhorn_volume_write_throughput{pvc_namespace="default",node="ip-10-0-2-151",pvc="volume-1",volume="volume-1"} 0 ``` And metrics with `longhorn_volume_` prefix should include `pvc=""` for (volume-2) ```bash > curl -sSL http://10.0.2.212:32744/metrics | grep longhorn_volume | grep ip-10-0-2-151 | grep volume-2 -longhorn_volume_actual_size_bytes{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 -longhorn_volume_capacity_bytes{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 1.073741824e+09 -longhorn_volume_read_iops{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 -longhorn_volume_read_latency{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 -longhorn_volume_read_throughput{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 -longhorn_volume_robustness{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 1 -longhorn_volume_state{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 2 -longhorn_volume_write_iops{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 -longhorn_volume_write_latency{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 -longhorn_volume_write_throughput{namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 +longhorn_volume_actual_size_bytes{pvc_namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 +longhorn_volume_capacity_bytes{pvc_namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 1.073741824e+09 +longhorn_volume_read_iops{pvc_namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 +longhorn_volume_read_latency{pvc_namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 +longhorn_volume_read_throughput{pvc_namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 +longhorn_volume_robustness{pvc_namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 1 +longhorn_volume_state{pvc_namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 2 +longhorn_volume_write_iops{pvc_namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 +longhorn_volume_write_latency{pvc_namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 +longhorn_volume_write_throughput{pvc_namespace="",node="ip-10-0-2-151",pvc="",volume="volume-2"} 0 ```