1

I have a simple question: when I write a rule in Prometheus, what is the type of the derived metric?
For example, if I have the following rule:

- record: derived_metric
  expr: increase(internal_metric[5m])

what is the type of "derived_metric"?
I assume that it is Gauge type.

C.S.
  • 77
  • 2
  • 9

1 Answers1

2

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.

Michael Doubez
  • 5,937
  • 25
  • 39