Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow multiple --type flags for metrics commands #642

Closed
apricote opened this issue Dec 15, 2023 · 1 comment · Fixed by #649 or #652
Closed

fix: Allow multiple --type flags for metrics commands #642

apricote opened this issue Dec 15, 2023 · 1 comment · Fixed by #649 or #652
Assignees
Labels

Comments

@apricote
Copy link
Member

When getting the metrics for Load Balancers and servers, the API allows the user to set multiple metrics types (cpu, disk, network for servers). The CLI currently only reads from the last specified --type flag. It would be nice if we used a StringSlice instead.

Current behaviour:

$ hcloud server metrics home-cloud-v3-l86p8-5vcvb --type cpu --type disk
Server: home-cloud-v3-l86p8-5vcvb 	 Metric: disk.0.bandwidth.read 	 Start: 2023-12-15 11:53:25 +0100 CET 	 End: 2023-12-15 12:23:25 +0100 CET
<graph removed>

Server: home-cloud-v3-l86p8-5vcvb 	 Metric: disk.0.bandwidth.write 	 Start: 2023-12-15 11:53:25 +0100 CET 	 End: 2023-12-15 12:23:25 +0100 CET
<graph removed>

Server: home-cloud-v3-l86p8-5vcvb 	 Metric: disk.0.iops.read 	 Start: 2023-12-15 11:53:25 +0100 CET 	 End: 2023-12-15 12:23:25 +0100 CET
<graph removed>

Server: home-cloud-v3-l86p8-5vcvb 	 Metric: disk.0.iops.write 	 Start: 2023-12-15 11:53:25 +0100 CET 	 End: 2023-12-15 12:23:25 +0100 CET
<graph removed>

As a workaround, it is currently possible to get back multiple types by concatenating them yourself with ,: --type cpu,disk

@phm07
Copy link
Contributor

phm07 commented Dec 19, 2023

The Load Balancer metrics command had the same issue. Fixed in #649

phm07 added a commit that referenced this issue Dec 19, 2023
This was referenced Dec 19, 2023
jooola pushed a commit that referenced this issue Dec 21, 2023
🤖 I have created a release *beep* *boop*
---


##
[1.41.1](v1.41.0...v1.41.1)
(2023-12-21)


### Bug Fixes

* allow multiple --type flags for metrics commands
([#649](#649))
([69346f7](69346f7)),
closes [#642](#642)
* integer fields are displayed as floats when using create with o=yaml
([#651](#651))
([2d42fcd](2d42fcd))
* integer fields are displayed as floats when using describe with
-o=yaml ([#650](#650))
([ee4c51e](ee4c51e)),
closes [#638](#638)
* wording when metrics are not yet available
([#639](#639))
([9298c46](9298c46))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants