Values and Units

Under the hood, Prometheus stores all values as 64bit floating point types. NaN, +Inf and -Inf are all possible.

This works nicely for tracking frequently updated metrics as a 64 bit float has 52 bits for the mantissa so if you're tracking something that increases a million times a second, it'd take 142 years to overflow!


Other systems chose to use integers, so you have to chose whether to export microseconds, nanoseconds, milliseconds, seconds, hours, days or weeks.

This gets messy, as this choice propagates all the way through the system. Instead it's best to leave choosing the displayed unit to the display layer, such as Grafana.

In Prometheus, the convention is to use base units, such as seconds and bytes. It's also best practice to include the unit type in the metric name, for example the bytes in process_resident_memory_bytes

Similarly, it's preferable to use ratios rather than percentages.


In regards to time, Prometheus uses millisecond resolution timestamps. This is sufficient in practice, as there are fundamental races in the metrics style of monitoring that are of a similar magnitude such as network blips and kernel scheduling.

Complete and Continue