OpenMetrics Summary Created Timestamp

84 views
Skip to first unread message

Fabian Stäber

unread,
May 24, 2022, 10:38:14 AM5/24/22
to Prometheus Developers
Hi Developers,

Reviewing the Created timestamps for Summary metrics, I'm not sure anymore if we do it right in client_java:

In the current implementation of Summary we have:
  • Count: Total number since application start.
  • Sum: Total number since application start.
  • Quantiles: Sliding time window, by default rotated every 10 minutes.
The Created timestamp is constant and refers to the application startup.

That means, the Created timestamp is correct for Count and Sum, but incorrect for the Quantiles, as the Quantiles are max 10 minutes old.

I'm wondering: Is this how the Created timestamp for Summary metrics is supposed to be implemented?

Fabian

Brian Brazil

unread,
May 24, 2022, 10:54:26 AM5/24/22
to Fabian Stäber, Prometheus Developers
On Tue, 24 May 2022 at 15:38, 'Fabian Stäber' via Prometheus Developers <prometheus...@googlegroups.com> wrote:
Hi Developers,

Reviewing the Created timestamps for Summary metrics, I'm not sure anymore if we do it right in client_java:

In the current implementation of Summary we have:
  • Count: Total number since application start.
  • Sum: Total number since application start.
  • Quantiles: Sliding time window, by default rotated every 10 minutes.
The Created timestamp is constant and refers to the application startup.

Created is for when a given child is created, which can be after this, and that's how it's coded:
 

That means, the Created timestamp is correct for Count and Sum, but incorrect for the Quantiles, as the Quantiles are max 10 minutes old.

It relates to the count/sum, not the quantiles. Same as for counters and histograms.
 

I'm wondering: Is this how the Created timestamp for Summary metrics is supposed to be implemented?

Unless I messed up, it is implemented correctly in client_java.

Brian
 

Fabian

--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/0796c263-769e-4003-a3cc-17091eaaaaecn%40googlegroups.com.


--

Bjoern Rabenstein

unread,
May 25, 2022, 11:30:12 AM5/25/22
to Brian Brazil, Fabian Stäber, Prometheus Developers
On 24.05.22 15:54, Brian Brazil wrote:
> On Tue, 24 May 2022 at 15:38, 'Fabian Stäber' via Prometheus Developers <
> prometheus...@googlegroups.com> wrote:
>
> >
> > I'm wondering: Is this how the Created timestamp for Summary metrics is
> > supposed to be implemented?
> >
>
> Unless I messed up, it is implemented correctly in client_java.

And IIRC, it's the same way in client_golang. That's just the way it
is. The pre-calculated quantiles are not very "Promethean", as you
cannot really do anything with them at query time. The count and the
sum in the Summary (and additionally the bucket counts in a Histogram)
can be used for any desired time range (in the `rate` or `increase`
function). They are just different beasts.

--
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] bjo...@rabenste.in
Reply all
Reply to author
Forward
0 new messages