Skip to content

Add storageUsage to the metricType enum - #115

Open
traviswu-bigstack wants to merge 1 commit into
developfrom
travis.wu/storage-usage-metric-type
Open

traviswu-bigstack wants to merge 1 commit into
developfrom
travis.wu/storage-usage-metric-type

Conversation

@traviswu-bigstack

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind feature

Which issue(s) this PR fixes?

Part of bigstack-oss/cubecos#1449. Companion to bigstack-oss/cubecos#1450 and the cube-cos-api change that implements the rank query.

What this PR does?

Adds storageUsage to the metricType enum so /metrics/{metricType}/rank/vms accepts it. The CubeCOS collector writes per-VM allocated bytes to the telegraf database; cube-cos-api ranks it.

Named storageUsage rather than diskUsage because diskUsage is already the host filesystem percentage — a different entity and a different unit.

The value is listed immediately after diskUsage in all four places it appears (enum, prose description, and the two 400-response examples) so the ordering stays consistent with the API's error string.

Test results (optional)

Spec parses; the enum was exercised end to end against a live cluster through the implementing cube-cos-api build — storageUsage returns 8 ranked VMs where it previously answered 400 bad request.

Per-VM allocated storage, ranked like the other VM metrics. The CubeCOS
collector (cubecos#1449) writes it to telegraf; this exposes it on
/metrics/{metricType}/rank/vms.

Named storageUsage rather than diskUsage because diskUsage is already taken
by the host filesystem percentage, and this is per-VM bytes allocated in the
storage pool -- a different entity and a different unit.

Listed right after diskUsage in the enum, both prose descriptions and both
error examples, so every place the values appear stays in the same order.

Signed-off-by: Travis Wu <travis.wu@bigstack.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant