cpu counter label mismatch between Darwin and FreeBSD? #414

Closed
justinclift opened this Issue Jan 10, 2017 · 4 comments

Projects

None yet

3 participants

@justinclift

Trying out the new cpu counters on Darwin, the counter name is "node_cpu":

# HELP node_cpu Seconds the cpus spent in each mode.
# TYPE node_cpu counter
node_cpu{cpu="cpu0",mode="idle"} 440807.2265625
node_cpu{cpu="cpu0",mode="nice"} 0
node_cpu{cpu="cpu0",mode="system"} 92817.453125
node_cpu{cpu="cpu0",mode="user"} 79377.7421875
node_cpu{cpu="cpu1",mode="idle"} 588251.2578125
node_cpu{cpu="cpu1",mode="nice"} 0
node_cpu{cpu="cpu1",mode="system"} 15171.109375
node_cpu{cpu="cpu1",mode="user"} 9577.2265625
node_cpu{cpu="cpu2",mode="idle"} 500066.6484375
node_cpu{cpu="cpu2",mode="nice"} 0
node_cpu{cpu="cpu2",mode="system"} 49800.625
node_cpu{cpu="cpu2",mode="user"} 63132.8046875
node_cpu{cpu="cpu3",mode="idle"} 588163.0546875
node_cpu{cpu="cpu3",mode="nice"} 0
node_cpu{cpu="cpu3",mode="system"} 15204.59375
node_cpu{cpu="cpu3",mode="user"} 9631.8359375
node_cpu{cpu="cpu4",mode="idle"} 503780.65625
node_cpu{cpu="cpu4",mode="nice"} 0
node_cpu{cpu="cpu4",mode="system"} 47630.3046875
node_cpu{cpu="cpu4",mode="user"} 61588.921875
node_cpu{cpu="cpu5",mode="idle"} 588132.34375
node_cpu{cpu="cpu5",mode="nice"} 0
node_cpu{cpu="cpu5",mode="system"} 15241.3984375
node_cpu{cpu="cpu5",mode="user"} 9625.640625
node_cpu{cpu="cpu6",mode="idle"} 505016.109375
node_cpu{cpu="cpu6",mode="nice"} 0
node_cpu{cpu="cpu6",mode="system"} 46982.6953125
node_cpu{cpu="cpu6",mode="user"} 61000.8984375
node_cpu{cpu="cpu7",mode="idle"} 588084.4375
node_cpu{cpu="cpu7",mode="nice"} 0
node_cpu{cpu="cpu7",mode="system"} 15281.40625
node_cpu{cpu="cpu7",mode="user"} 9633.4296875

Looking at the cpu counter for FreeBSD, it seems to be called "node_cpu_seconds_total":

# HELP node_cpu_seconds_total Seconds the CPU spent in each mode.
# TYPE node_cpu_seconds_total counter
node_cpu_seconds_total{cpu="0",mode="idle"} 4617.086614173229
node_cpu_seconds_total{cpu="0",mode="interrupt"} 35.92913385826772
node_cpu_seconds_total{cpu="0",mode="nice"} 0
node_cpu_seconds_total{cpu="0",mode="system"} 2665.818897637795
node_cpu_seconds_total{cpu="0",mode="user"} 15176.952755905511
node_cpu_seconds_total{cpu="1",mode="idle"} 4609.724409448819
node_cpu_seconds_total{cpu="1",mode="interrupt"} 9.291338582677165
node_cpu_seconds_total{cpu="1",mode="nice"} 0
node_cpu_seconds_total{cpu="1",mode="system"} 2567.0236220472443
node_cpu_seconds_total{cpu="1",mode="user"} 15307.976377952757
node_cpu_seconds_total{cpu="2",mode="idle"} 4441.716535433071
node_cpu_seconds_total{cpu="2",mode="interrupt"} 8.338582677165354
node_cpu_seconds_total{cpu="2",mode="nice"} 0
node_cpu_seconds_total{cpu="2",mode="system"} 2511.6535433070867
node_cpu_seconds_total{cpu="2",mode="user"} 15532.307086614173
node_cpu_seconds_total{cpu="3",mode="idle"} 4590.393700787402
node_cpu_seconds_total{cpu="3",mode="interrupt"} 107.97637795275591
node_cpu_seconds_total{cpu="3",mode="nice"} 0
node_cpu_seconds_total{cpu="3",mode="system"} 2463.968503937008
node_cpu_seconds_total{cpu="3",mode="user"} 15331.677165354331

If they're for the same thing (seems to be?), shouldn't they use the same metric name to make things easier for cross-platform measurement comparison?

Pointing it out because it's making things a bit tricky with the default/example node exporter dashboards in Grafana. 😉

@justinclift

Hmmmm, thinking about this more, it may not be useful to keep the same counter name across OS's. Pretty much everything other than CPU has different requirements, so using "one dashboard per OS" seems fairly mandatory for host monitoring.

@brian-brazil
Member

The FreeBSD name is the better name, and we'll likely be changing the Linux one over to that at some point in the future.

@justinclift

No worries. 😄

@discordianfish
Member

I used node_cpu for darwin to stay consistent with linux, but yes the freebsd name is better. Guess it makes sense to renaming them all together at some point. Going to close this here in favor of #150 which discusses consolidating of the metrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment