clj-commons / iapetos

A Clojure Prometheus Client
https://clj-commons.org/iapetos/
MIT License
177 stars 31 forks source link

Remove `dec` function #53

Closed Limess closed 3 years ago

Limess commented 3 years ago

Prometheus counters should be monotonically increasing

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.

See https://github.com/prometheus/client_ruby/pull/17 for a similar change on the ruby client with further explanation in the linked issue.

There might be some other use case for this..? Brian suggests there is in the Ruby client PR but I can't think of it.

Limess commented 3 years ago

I realised this is also applied to gauges after checking https://prometheus.io/docs/instrumenting/writing_clientlibs/, ignore this then!