OpenMetrics Protobuf Metrics have two timestamps

13 views
Skip to first unread message

Fabian Stäber

unread,
Dec 7, 2022, 3:42:30 PM12/7/22
to Prometheus Developers
Hi,

In OpenMetrics protobuf each metric (i.e. each time series) has an optional timestamp:

message MetricPoint {
 
  oneof value {
      UnknownValue unknown_value = 1;
      GaugeValue gauge_value = 2;
      CounterValue counter_value = 3;
      HistogramValue histogram_value = 4;
      StateSetValue state_set_value = 5;
      InfoValue info_value = 6;
      SummaryValue summary_value = 7;
  }

  google.protobuf.Timestamp timestamp = 8;
}

However, this is NOT the created timestamp. Counters, Histograms, and Summaries have a created timestamp in addition to that:

message CounterValue {
  oneof total {
    double double_value = 1;
    uint64 int_value = 2;
  }
  google.protobuf.Timestamp created = 3;
  Exemplar exemplar = 4;
}


I'm struggling to understand why there are two timestamps. Can we remove one of them?

Fabian

gout...@gmail.com

unread,
Dec 7, 2022, 3:59:17 PM12/7/22
to Fabian Stäber, Prometheus Developers
One of them is the sample timestamp right? Or am I missing something?

Essentially a sample is (ts, v). And the ts is the timestamp inside metricpoint? It is confusing though because I would expected created to be next to timestamp. But I guess the current way makes sure only counters, histograms and summaries have a created timestamp. 

Thanks
Goutham. 

On 8. Dec 2022, at 02:12, 'Fabian Stäber' via Prometheus Developers <prometheus...@googlegroups.com> wrote:


--
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/CAPX310jkgmFYkQZk3emDgCiV9V%2Bnu2WJYH5ytNBCFunSB-wOcg%40mail.gmail.com.

Fabian Stäber

unread,
Dec 7, 2022, 4:02:54 PM12/7/22
to Prometheus Developers
Oh, it's the timestamps that are next to Exemplars in text format. Ok, I forgot about them. Thank you!

Fabian
Reply all
Reply to author
Forward
0 new messages