Using counters
Counter and UpDownCounter represent additive values – values that it makes sense to sum up. For example, the sum of incoming request counts with different HTTP methods makes sense, but the sum of CPU utilization across different cores does not.
On the instrumentation side, the only difference between Counter and UpDownCounter is that the former increases monotonically (or stays the same), while the latter can decrease. For example, the number of open and closed connections should be represented by Counter, while the number of active connections should be represented by UpDownCounter.
Both kinds of counters can be synchronous and asynchronous:
- Synchronous counters report a delta of value when change happens. For example, once we successfully initiate a new connection, we can increment counters for both open and active connections. Once we’ve finished terminating a connection, we decrement the number of active connections only.
- Asynchronous...