Allow UpDown counters to be 'set' #2054
Labels
release:after-ga
Not required before GA release, and not going to work on before GA
spec:metrics
Related to the specification/metrics directory
Current spec for UpDownCounters
If the state is based on, for example, the length of an array (eg a list of connected clients), this requires the previous state to be stored somewhere so that subtraction can happen.
Proposal:
.set(25)
Allow the instrument to be set, this can be then used to map to properties of data structures which inform this and remove the need for diffing. This is possible with an observer but using this required substantial changes to our app and exposing state where we don’t want to. With a synchronous set method, this can be done within methods without exposing internal state to observers.
The Nodejs package ‘prom-client’ has this functionality already and we find it very useful.
The text was updated successfully, but these errors were encountered: