-
Notifications
You must be signed in to change notification settings - Fork 9
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
In counter have a set value option #12
Comments
Seconded. |
Unfortunately, the underlying library (prom-client) does not support setting values of "Counter" type metrics explicitly: As you can see in the code, it includes a setValue function internally, but does not expose it in the Counter class. The only workaround seems to me to first reset the value and then increment by the new value. |
#19 solves this by adding a reset parameter, which, if set, resets the metric before the operation. This way this payload behaves like a {
reset: true,
op: "inc",
val: 5000,
} |
Would be handy to have a set value option in the counter like guage. The source I'm using (Total kWh in a energy meter) so I just need to set the value not increase it by a certain amount.
The text was updated successfully, but these errors were encountered: