CPU used in bytes

174 views
Skip to first unread message

Darshil Saraiya

unread,
Aug 1, 2017, 7:05:56 PM8/1/17
to Prometheus Developers
I am using prometheus 1.7.0 and kubernetes 1.6.7.
I want to have cpu used in bytes. Now, I see a lot of cpu metrics which gives cpu usage in time. So, is there anything that can give me the usage in metrics. The usage can be anything i.e. per container, per pod, per node, per cluster - anything

TIA.

Callum Styan

unread,
Aug 1, 2017, 7:44:11 PM8/1/17
to Darshil Saraiya, Prometheus Developers
Since you already have cpu usage in time I'm assuming you're using node_exporter, which is a metric. Measuring cpu usage in bytes is not really a thing, it just executes instructions. Perhaps you want IO usage in bytes?

For future reference, and if you wish to elaborate on what you're looking for with your original question, please use prometheus-users (https://groups.google.com/forum/#!forum/prometheus-users) for usage related questions. This mailing list is for discussions related to development of Prometheus itself.
 

--
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-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/ff908962-b22e-4d98-aed2-6cd6f4616de7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Darshil Saraiya

unread,
Aug 2, 2017, 5:53:45 PM8/2/17
to Prometheus Developers, sdars...@gmail.com
Hi,

I've done a mistake writing usage in bytes. I want usage in its units like Hz(HERTZ) and not in bytes. 

On Tuesday, 1 August 2017 16:44:11 UTC-7, Callum Styan wrote:
Since you already have cpu usage in time I'm assuming you're using node_exporter, which is a metric. Measuring cpu usage in bytes is not really a thing, it just executes instructions. Perhaps you want IO usage in bytes?

For future reference, and if you wish to elaborate on what you're looking for with your original question, please use prometheus-users (https://groups.google.com/forum/#!forum/prometheus-users) for usage related questions. This mailing list is for discussions related to development of Prometheus itself.
 
On Tue, Aug 1, 2017 at 4:05 PM, Darshil Saraiya <sdars...@gmail.com> wrote:
I am using prometheus 1.7.0 and kubernetes 1.6.7.
I want to have cpu used in bytes. Now, I see a lot of cpu metrics which gives cpu usage in time. So, is there anything that can give me the usage in metrics. The usage can be anything i.e. per container, per pod, per node, per cluster - anything

TIA.

--
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-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus...@googlegroups.com.

Werner Keil

unread,
Jul 4, 2018, 11:56:33 AM7/4/18
to Prometheus Developers
I think that is not supported by Prometheus at the moment. 
Other systems like Grafana include a larger set of units, AFAIK Hz should also be part of it.

Together with Eclipse MicroProfile Metrics we (the Units of Measurement Project behind standards like JSR 363) work on support for different units via Prometheus or possible follow-up protocols like OpenMetrics. 
See https://github.com/unitsofmeasurement/uom-domain/tree/master/cloud if you are interested, Hz is not yet applied, but the underlying unit systems of course provide it already, so it would be no problem to include it.


Am Mittwoch, 2. August 2017 23:53:45 UTC+2 schrieb Darshil Saraiya:
Hi,

I've done a mistake writing usage in bytes. I want usage in its units like Hz(HERTZ) and not in bytes. 

On Tuesday, 1 August 2017 16:44:11 UTC-7, Callum Styan wrote:
Since you already have cpu usage in time I'm assuming you're using node_exporter, which is a metric. Measuring cpu usage in bytes is not really a thing, it just executes instructions. Perhaps you want IO usage in bytes?

For future reference, and if you wish to elaborate on what you're looking for with your original question, please use prometheus-users (https://groups.google.com/forum/#!forum/prometheus-users) for usage related questions. This mailing list is for discussions related to development of Prometheus itself.
 
On Tue, Aug 1, 2017 at 4:05 PM, Darshil Saraiya <sdars...@gmail.com> wrote:
I am using prometheus 1.7.0 and kubernetes 1.6.7.
I want to have cpu used in bytes. Now, I see a lot of cpu metrics which gives cpu usage in time. So, is there anything that can give me the usage in metrics. The usage can be anything i.e. per container, per pod, per node, per cluster - anything

TIA.

--
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-developers+unsubscribe.

Ben Kochie

unread,
Jul 4, 2018, 12:19:00 PM7/4/18
to werne...@gmail.com, Prometheus Developers
Prometheus does not restrict any units from being exposed, this is entirely up to the underlying system. It is perfectly possible to express values in hertz if the underlying data is that way. For example I have a system that exposes the mains electrical frequency in hertz with a high degree of accuracy, and I store this in Prometheus as `system_freuqnecy_hertz`.

To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.

To post to this group, send email to prometheus...@googlegroups.com.

Werner Keil

unread,
Jul 4, 2018, 12:39:43 PM7/4/18
to Prometheus Developers
Well that's good to know. The list https://prometheus.io/docs/practices/naming/ does not contain many, but those it does are named explicitly.
"bytes" instead of "byte" but it looks like other systems like Grafana do it the same way:

Some like "celsius" are on the other hand singular, there seems no proper plural ("celsii"?;-) so the naming seems a little inconsistent.

I would expect at least in an open standard effort like OpenMetrics, OpenCensus or whatever gets pursued now to mention that so other systems are aware that they may need some mapping if "byte" is used instead of "bytes" etc.

I guess "hertz" is another example which is also an exception from the pluralization of unit names?
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.

Ben Kochie

unread,
Jul 4, 2018, 1:07:29 PM7/4/18
to werne...@gmail.com, Prometheus Developers
On Wed, Jul 4, 2018 at 6:39 PM Werner Keil <werne...@gmail.com> wrote:
Well that's good to know. The list https://prometheus.io/docs/practices/naming/ does not contain many, but those it does are named explicitly.
"bytes" instead of "byte" but it looks like other systems like Grafana do it the same way:

Some like "celsius" are on the other hand singular, there seems no proper plural ("celsii"?;-) so the naming seems a little inconsistent.

This is counters vs gauges.

A byte can be counted, hence plural bytes in a counter. I.e. node_network_transmit_bytes_total

Degrees generally can't be counted, and are represented as a gauge, hence celcius. I.e. node_cpu_temperature_celcius
 
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.

--
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 post to this group, send email to prometheus...@googlegroups.com.

Werner Keil

unread,
Jul 4, 2018, 1:21:35 PM7/4/18
to Prometheus Developers
So are bytes never meant to be used in a gauge or would it be "byte" in such case?

The documentation is not clear on that:

IMO the "base unit" should not depend on the type of metric, but if there is some (best written) convention that in some case it should be plural because of multiple metric entries gathered, while other types only represent a singular unit value, that would be fine.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.

--
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-developers+unsub...@googlegroups.com.

Brian Brazil

unread,
Jul 4, 2018, 1:54:33 PM7/4/18
to Werner Keil, Prometheus Developers
On 4 July 2018 at 18:21, Werner Keil <werne...@gmail.com> wrote:
So are bytes never meant to be used in a gauge or would it be "byte" in such case?

It'd still be bytes. process_resident_memory_bytes for example.

Brian
 
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsubscri...@googlegroups.com.

--
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-developers+unsubscri...@googlegroups.com.

To post to this group, send email to prometheus...@googlegroups.com.

--
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-developers+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Werner Keil

unread,
Jul 4, 2018, 1:59:05 PM7/4/18
to Prometheus Developers
So if there is any rule of thumb or unwritten convention, it would be whatever can be used in more than just a Gauge type should be plural?

Werner
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.

--
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-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus...@googlegroups.com.

--
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-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus...@googlegroups.com.



--

Julius Volz

unread,
Jul 4, 2018, 2:14:16 PM7/4/18
to Werner Keil, Prometheus Developers
On Wed, Jul 4, 2018 at 7:59 PM, Werner Keil <werne...@gmail.com> wrote:
So if there is any rule of thumb or unwritten convention, it would be whatever can be used in more than just a Gauge type should be plural?

I'd assume the rule is: if it's a countable thing (cows are countable, milk is not), it's plural. You don't count Celsiuses, if at all you would count degrees Celsius, but even then they are not usually something you think of as a count.

So I think yes, if something is a unit used in counters, it's always going to be plural.

To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsubscri...@googlegroups.com.

--
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-developers+unsubscri...@googlegroups.com.

To post to this group, send email to prometheus...@googlegroups.com.

--
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-developers+unsubscri...@googlegroups.com.

To post to this group, send email to prometheus...@googlegroups.com.



--

--
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-developers+unsub...@googlegroups.com.

Werner Keil

unread,
Jul 4, 2018, 2:46:36 PM7/4/18
to Prometheus Developers


On Wednesday, July 4, 2018 at 8:14:16 PM UTC+2, Julius Volz wrote:
On Wed, Jul 4, 2018 at 7:59 PM, Werner Keil <werne...@gmail.com> wrote:
So if there is any rule of thumb or unwritten convention, it would be whatever can be used in more than just a Gauge type should be plural?

I'd assume the rule is: if it's a countable thing (cows are countable, milk is not), it's plural. You don't count Celsiuses, if at all you would count degrees Celsius, but even then they are not usually something you think of as a count.

So I think yes, if something is a unit used in counters, it's always going to be plural.

Whenever some sort of "spec" for OpenMetrics comes up (I did not see anything, the list here is mute since late 2017) I would expect something like that in it 

"milk" as such may not be countable, but you tend to measure it in "litres" (or "liters", given the length is called "meters" as well) 
or other non-metric units like "liquid gallons" etc. If you just count it, then something like "cartons" sounds logical, Pivotal's Micrometer I think uses examples of "eggs" or "beans" ;-) 
 


To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.

--
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-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus...@googlegroups.com.

--
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-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus...@googlegroups.com.



--

--
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-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages