- Counter : A counter is a cumulative metric that represents a single monotonically increasing counter whose value can only increase or be reset to zero on restart.
- Gauge: A gauge is a metric that represents a single numerical value that can arbitrarily go up and down.
- Histogram: A histogram samples observations (usually things like request durations or response sizes) and counts them in configurable buckets. It also provides a sum of all observed values.
- Summary: Similar to a histogram, a summary samples observations (usually things like request durations and response sizes).
when to use which metric type?
- Counters are values that can only increase that keep track of the number of events. For example, we would use counters to start a number of requests, number of errors or the number of Finnish transactions.
- Gauge is another type of metric that represents numerical value on like counters. Gauges can go up and down to represent the current state of the system. We can use gauges for information that can both increase and decrease over time. For example, memory usage, CPU usage temperature but also a number of conquering requests.
- Histogram sample observations and count them in configurable buckets. This way we can check how many requests finish within a given time or how many responses fit within a given size, Histogram exposed several metrics for us to query.
- Summaries calculate configurable. lt's over a sliding time window. In general, many use cases of summaries can be covered with Histogram.
Reference
- Documentation: Metric Types