Skip to content

Commit

Permalink
rename pvc capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
r0fls committed Feb 21, 2019
1 parent 418427a commit 37f5206
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Documentation/persistentvolume-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_persistentvolume_capacity | Gauge | `persistentvolume`=<pv-name> | STABLE |
| kube_persistentvolume_capacity_bytes | Gauge | `persistentvolume`=<pv-name> | STABLE |
| kube_persistentvolume_status_phase | Gauge | `persistentvolume`=&lt;pv-name&gt; <br>`phase`=&lt;Bound\|Failed\|Pending\|Available\|Released&gt;| STABLE |
| kube_persistentvolume_labels | Gauge | `persistentvolume`=&lt;persistentvolume-name&gt; <br> `label_PERSISTENTVOLUME_LABEL`=&lt;PERSISTENTVOLUME_LABEL&gt; | STABLE |
| kube_persistentvolume_info | Gauge | `persistentvolume`=&lt;pv-name&gt; <br> `storageclass`=&lt;storageclass-name&gt; | STABLE |
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/persistentvolume.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ var (
}),
},
{
Name: "kube_persistentvolume_capacity",
Name: "kube_persistentvolume_capacity_bytes",
Type: metric.MetricTypeGauge,
Help: "Persistentvolume capacity in bytes.",
GenerateFunc: wrapPersistentVolumeFunc(func(p *v1.PersistentVolume) *metric.Family {
Expand Down
8 changes: 4 additions & 4 deletions internal/collector/persistentvolume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ func TestPersistentVolumeCollector(t *testing.T) {
# TYPE kube_persistentvolume_labels gauge
# HELP kube_persistentvolume_info Information about persistentvolume.
# TYPE kube_persistentvolume_info gauge
# HELP kube_persistentvolume_capacity The size of the Persistentvolume in bytes.
# TYPE kube_persistentvolume_capacity gauge
# HELP kube_persistentvolume_capacity_bytes The size of the Persistentvolume in bytes.
# TYPE kube_persistentvolume_capacity_bytes gauge
`
cases := []generateMetricsTestCase{
// Verify phase enumerations.
Expand Down Expand Up @@ -216,9 +216,9 @@ func TestPersistentVolumeCollector(t *testing.T) {
},
},
Want: `
kube_persistentvolume_capacity{persistentvolume="test-pv"} 5.36870912e+09
kube_persistentvolume_capacity_bytes{persistentvolume="test-pv"} 5.36870912e+09
`,
MetricNames: []string{"kube_persistentvolume_capacity"},
MetricNames: []string{"kube_persistentvolume_capacity_bytes"},
},
}
for i, c := range cases {
Expand Down

0 comments on commit 37f5206

Please sign in to comment.