Extra # TYPE lines allowed in metrics pushed to Pushgateway

20 views
Skip to first unread message

Jeff Berkowitz

unread,
Apr 9, 2020, 6:02:49 PM4/9/20
to Prometheus Developers
The Pushgateway (1.2.0) accepts "# TYPE metric-name metric-type" lines even when the metric-name does not occur in the push data.

Is this a quirk in the Pushgateway implementation or is it an intentional feature? The exposition spec covers the case of a metric-name without an explicit metric-type. The spec does not mention the case of an explicit metric-type without a metric-name.

I am an employee of Oracle USA.

Julien Pivotto

unread,
Apr 9, 2020, 6:06:38 PM4/9/20
to Prometheus Developers
This is valid.

The HELP do not change per labelset and you don't always know the labels in advance, so you can register metrics before they actually have a value or labelsets.

Brian Brazil

unread,
Apr 9, 2020, 6:07:05 PM4/9/20
to Jeff Berkowitz, Prometheus Developers
On Thu, 9 Apr 2020 at 23:02, Jeff Berkowitz <pdx...@gmail.com> wrote:
The Pushgateway (1.2.0) accepts "# TYPE metric-name metric-type" lines even when the metric-name does not occur in the push data.

Is this a quirk in the Pushgateway implementation or is it an intentional feature? The exposition spec covers the case of a metric-name without an explicit metric-type. The spec does not mention the case of an explicit metric-type without a metric-name.

That is valid in the exposition format, as you might have a labelled metric that doesn't have any children yet.

Brian
 

I am an employee of Oracle USA.

--
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/3f6ba686-11af-48e7-8476-8abc0e801dbf%40googlegroups.com.


--

Julien Pivotto

unread,
Apr 9, 2020, 6:07:07 PM4/9/20
to Prometheus Developers
This applies to HELP and TYPE.

Jeff Berkowitz

unread,
Apr 9, 2020, 10:44:07 PM4/9/20
to Prometheus Developers
Thank you Brian and Julien!
Reply all
Reply to author
Forward
0 new messages