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

Support float64 rates for telemetrygen #33982

Closed
damemi opened this issue Jul 9, 2024 · 3 comments · Fixed by #33984
Closed

Support float64 rates for telemetrygen #33982

damemi opened this issue Jul 9, 2024 · 3 comments · Fixed by #33984
Labels
cmd/telemetrygen telemetrygen command enhancement New feature or request

Comments

@damemi
Copy link
Contributor

damemi commented Jul 9, 2024

Component(s)

cmd/telemetrygen

Is your feature request related to a problem? Please describe.

Using float values in --rate returns the following error:

Error: invalid argument "0.1" for "--rate" flag: strconv.ParseInt: parsing "0.1": invalid syntax

The --rate flag for telemetrygen is an Int64Var, however this is ultimately parsed to a rate.Limit value, which is an alias for float64.

I propose changing this flag to a Float64Var to allow non-integer rates. My specific use case is to set this value to something like 0.2, to send a metric once every 5 seconds. Currently, the slowest rate I can set is 1, exporting a metric every second (which is an aggressive rate).

Describe the solution you'd like

Support rates <1/second

Describe alternatives you've considered

We could also use rate.Every() to specify something like this, which might be clearer. But this just parses to a rate.Limit, so I think it is just syntactical sugar

Additional context

No response

@damemi damemi added enhancement New feature or request needs triage New item requiring triage labels Jul 9, 2024
@github-actions github-actions bot added the cmd/telemetrygen telemetrygen command label Jul 9, 2024
Copy link
Contributor

github-actions bot commented Jul 9, 2024

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@damemi
Copy link
Contributor Author

damemi commented Jul 9, 2024

Opened #33984 as a fix

@crobert-1
Copy link
Member

A code owner has approved the PR to resolve this issue, I'm going to remove the needs triage label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/telemetrygen telemetrygen command enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants