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

Counters can be decremented #16

Closed
jc opened this issue Sep 11, 2015 · 2 comments
Closed

Counters can be decremented #16

jc opened this issue Sep 11, 2015 · 2 comments

Comments

@jc
Copy link

jc commented Sep 11, 2015

The prometheus documentation states that:

Counters should not be used to expose current counts of items whose number can also go down, e.g. the number of currently running goroutines.

Currently counters can be decremented by decrement or passing a negative value into increment.

@juliusv
Copy link
Member

juliusv commented Sep 11, 2015

Yeah, the Go client library doesn't have a decrement and even checks for negative increment values (https://github.com/prometheus/client_golang/blob/master/prometheus/counter.go#L67-L72). This should be made consistent in the Ruby client as well.

@grobie
Copy link
Member

grobie commented Sep 11, 2015

The client is older than the document. Makes sense.

grobie added a commit that referenced this issue Sep 11, 2015
It was decided that counters should always be monotonically increasing,
so we have to remove possibilities to decrement a counter.

Fixes #16.
grobie added a commit that referenced this issue Sep 11, 2015
It was decided that counters should always be monotonically increasing,
so we have to remove possibilities to decrement a counter.

Fixes #16.
grobie added a commit that referenced this issue Sep 11, 2015
It was decided that counters should always be monotonically increasing,
so we have to remove possibilities to decrement a counter.

Fixes #16.
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

3 participants