is this a valid prometheus exposition?

29 views
Skip to first unread message

Vishwanath N

unread,
Jun 23, 2023, 10:12:39 PM6/23/23
to prometheus...@googlegroups.com
hi all - is below a valid prometheus exposition for a gauge -  pls note that except time stamps and values for the datapoints the label and label values are the same . 

 if this is a valid gauge, what will be the behavior when honor_timestamps = true ?

 # TYPE my_gauge gauge
my_gauge 1 1687479732169
my_gauge 0 1687479737169
my_gauge 1 1687479742169




thanks . 

Julius Volz

unread,
Jun 26, 2023, 12:05:52 PM6/26/23
to Vishwanath N, prometheus...@googlegroups.com
Hi Vishwanath,

This is not valid for the text exposition format, since the same time series is repeated multiple times. See https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format - "Each line must have a unique combination of a metric name and labels. Otherwise, the ingestion behavior is undefined.".

Other interfaces for writing data into Prometheus, like the remote write receiver (https://prometheus.io/docs/prometheus/latest/querying/api/#remote-write-receiver), support sending more than one sample per series at once, but whether that's the right interface to use for your use case depends on the details of what you're trying to do.

Regards,
Julius

--
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/MW4PR04MB7170F604B4C4803FD408B80EA520A%40MW4PR04MB7170.namprd04.prod.outlook.com.


--
Julius Volz
PromLabs - promlabs.com
Reply all
Reply to author
Forward
0 new messages