As indicated, in the documentation:
The Prometheus client libraries offer four core metric types. These are currently only
differentiated in the client libraries (to enable APIs tailored to the usage of the
specific types) and in the wire protocol.
The Prometheus server does not yet make use of the type information and flattens all data into untyped time series.
This means that for all purposes, metrics in Prometheus are untyped. The type is only used as a contract for some functions (like increase()
expecting a counter
input).
You are right that, if we had a more strongly typing system, you could write that the output of function increase()
is of gauge
type.