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

Unable to report a metric with value of 0 #30

Open
SlicedSilver opened this issue Jan 23, 2023 · 0 comments
Open

Unable to report a metric with value of 0 #30

SlicedSilver opened this issue Jan 23, 2023 · 0 comments

Comments

@SlicedSilver
Copy link

SlicedSilver commented Jan 23, 2023

if (!options.value) throw new Error('"value" is missing')

Currently it is not possible to report a metric of zero because the library checks the value as shown above. Shouldn't the library rather check if the value is undefined, null, or an empty string?

This would allow the library to report values of zero.

if (options.value == undefined || options.value === '') throw new Error('"value" is missing')

Happy to submit a PR.

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

No branches or pull requests

1 participant