Meter provides instruments used to record measurements:
- Counter - A value that accumulates over time – you can think of this like an odometer on a car; it only ever goes up. There is also an aynchronous flavor of a counter.
- Gauge - Measures a current value at the time it is read. An example would be the fuel gauge in a vehicle.
- Historgram - A client-side aggregation of values, such as request latencies. A histogram is a good choice if you are interested in value statistics. For example: How many requests take fewer than 1s?
- Up/Down Counter - A value that accumulates over time, but can also go down again. An example could be a queue length, it will increase and decrease with the number of work items in the queue. There is also an aynchronous flavor of an up/down counter.
The below snippet shows how to obtain a meter from an OpenTelemetry instance:
Meter meter = openTelemetry.getMeter(getClass().getModule().getName());