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

rrd2csv: Accept a trailing comma in metrics names #6214

Conversation

last-genius
Copy link
Contributor

rrd2csv itself prints out a list of comma-separated metrics names, but could't accept this list as command line arguments:

$ rrd2csv
.....memory_total_kib, memory_free_kib, ....

$ rrd2csv memory_total_kib, memory_free_kib
WARNING: Requested metric AVERAGE:host:05e817e2-3a65-484d-b0da-a7163f9ffc12:memory_total_kib,
is disabled or non-existant
timestamp, AVERAGE:host:05e817e2-3a65-484d-b0da-a7163f9ffc12:memory_free_kib
2025-01-07T14:06:45Z, 30042000

Now this works just fine:

$ rrd2csv memory_total_kib, memory_free_kib
timestamp, AVERAGE:host:92bc3b1e-e0a3-49ba-8994-fc305ff882b7:memory_total_kib, AVERAGE:host:92bc3b1e-e0a3-49ba-8994-fc305ff882b7:memory_free_kib
2025-01-07T15:04:50Z, 33350000, 30023000

@last-genius last-genius force-pushed the private/asultanov/better-rrd2csv branch from f134ec3 to 7e91677 Compare January 7, 2025 15:10
Copy link
Contributor

@lindig lindig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But does this mean that the previous splitting on : no longer works and this could break external tools? Maybe we should split on either?

@last-genius
Copy link
Contributor Author

But does this mean that the previous splitting on : no longer works and this could break external tools? Maybe we should split on either?

Now it first splits on the commas, then on :

@last-genius last-genius force-pushed the private/asultanov/better-rrd2csv branch from 9a0b396 to 840a52e Compare January 8, 2025 16:17
rrd2csv itself prints out a list of comma-separated metrics names, but could't
accept this list as command line arguments:

```
$ rrd2csv
.....memory_total_kib, memory_free_kib, ....

$ rrd2csv memory_total_kib, memory_free_kib
WARNING: Requested metric AVERAGE:host:05e817e2-3a65-484d-b0da-a7163f9ffc12:memory_total_kib,
is disabled or non-existant
timestamp, AVERAGE:host:05e817e2-3a65-484d-b0da-a7163f9ffc12:memory_free_kib
2025-01-07T14:06:45Z, 30042000
```

Now this works just fine:
```
$ rrd2csv memory_total_kib, memory_free_kib
timestamp, AVERAGE:host:92bc3b1e-e0a3-49ba-8994-fc305ff882b7:memory_total_kib, AVERAGE:host:92bc3b1e-e0a3-49ba-8994-fc305ff882b7:memory_free_kib
2025-01-07T15:04:50Z, 33350000, 30023000
```

Signed-off-by: Andrii Sultanov <[email protected]>
@last-genius last-genius force-pushed the private/asultanov/better-rrd2csv branch from 840a52e to 32b154e Compare January 8, 2025 16:18
@lindig
Copy link
Contributor

lindig commented Jan 9, 2025

Would suggest to undraft and merge

@last-genius last-genius marked this pull request as ready for review January 9, 2025 10:46
@last-genius last-genius added this pull request to the merge queue Jan 9, 2025
Merged via the queue into xapi-project:master with commit 53a081c Jan 9, 2025
15 checks passed
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.

3 participants