Prometheus client_model protobuf question

19 views
Skip to first unread message

Fabian Stäber

unread,
Nov 4, 2022, 5:17:37 PM11/4/22
to Prometheus Developers
Hi,

I'm implementing the metrics.proto exposition format in client_java because it's needed for native histograms.

Now, I'm not sure how to set the MetricFamily.name field for Counter metrics.

Should I use the name including the "_total" suffix here or without the "_total" suffix?

Fabian

Bjoern Rabenstein

unread,
Nov 14, 2022, 5:50:19 AM11/14/22
to Fabian Stäber, Prometheus Developers
On 04.11.22 22:16, 'Fabian Stäber' via Prometheus Developers wrote:
>
> Now, I'm not sure how to set the MetricFamily.name field for Counter
> metrics.
>
> Should I use the name including the "_total" suffix here or without the
> "_total" suffix?

Short answer: Include the _total suffix.

Longer answer: OpenMetrics mandates to remove the _total suffix in the
metric family. That's a breaking change from the original Prometheus
format, both text and protobuf. (Which implies that you need to remove
the suffix when implementing the OpenMetrics protobuf format.) While
the change makes sense from a certain consistency perspective, I
personally think it's not worth the breakage it causes in many cases
(among them the collision of two standard Go metrics exposed by
prometheus/client_golang). It is one of a number of adoption hurdles,
and I would love to see this decision revisited.

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