mesos_exporter icon indicating copy to clipboard operation
mesos_exporter copied to clipboard

Classic Incorrect Label Values Problem

Open Smithx10 opened this issue 6 years ago • 2 comments

After a discussion with SuperQ on IRC he concluded the following:

There are labels for "percent", "total", "free", and "used". This makes using Prometheus harder.

If they correctly used the metric, it would look like this:

(mesos_master_allocator_resources_free_cpus + mesos_master_allocator_resources_used_cpus) and mesos_master_elected == 1

At a minimum, they should just delete the percent and total so you could do it this way:

sum without (type) (mesos_master_allocator_resources_cpus) and mesos_master_elected == 1

I guess the request is to follow prometheus exporter best practices.

Smithx10 avatar Sep 21 '18 14:09 Smithx10

I would probably do these two metrics:

mesos_master_allocator_resources_used_cpus
mesos_master_allocator_resources_total_cpus

This way it's easier to derive things:

  • Used ratio: mesos_master_allocator_resources_used_cpus / mesos_master_allocator_resources_total_cpus
  • Free ratio 1 - (mesos_master_allocator_resources_used_cpus / mesos_master_allocator_resources_total_cpus)
  • Free: mesos_master_allocator_resources_total_cpus - mesos_master_allocator_resources_used_cpus

It also makes it easier to join like pointed out above, and reduces the number of metrics that need to be stored.

SuperQ avatar Sep 21 '18 14:09 SuperQ

This is very similar to #11. I'm in favor of both of these issues, however we need to consider backwards compatibility for everyone who already has dashboards built on the current metrics.

jpeach avatar Oct 15 '18 21:10 jpeach