Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu: Metric 'package_throttles_total' is per package. #657

Merged
merged 4 commits into from
Sep 7, 2017

Conversation

knweiss
Copy link
Contributor

@knweiss knweiss commented Aug 23, 2017

'package_throttles_total' is per package, not per cpu. This also reduces
the total number of cpu time series a lot (esp for multi core cpus).

Also add some missing fixtures for cpu2 and cpu3 for consistency.

@knweiss
Copy link
Contributor Author

knweiss commented Aug 23, 2017

@rtreffer @SuperQ This PR has only limited testing (among other things because of Issue #644). Please review it.

Also, please notice that I decided to use the label node instead of package for the package as node is already used by other collectors:

node_cpu_package_throttles_total{node="0"} 30

Feedback is welcome!

BTW: IMHO the cpu label values should also be changed from

node_cpu_core_throttles_total{cpu="cpu0"} 5

to

node_cpu_core_throttles_total{cpu="0"} 5

for consistency.

@SuperQ
Copy link
Member

SuperQ commented Aug 23, 2017

I think those missing fixtures were explicitly missing for some tests.

@knweiss
Copy link
Contributor Author

knweiss commented Aug 23, 2017

@SuperQ Hm, I didn't catch that (but also didn't notice any test failures after adding them). Feel free to drop this hunk from the PR if you want.

@SuperQ
Copy link
Member

SuperQ commented Aug 23, 2017

Adding the metrics to the e2e output masks the error. 😜

@knweiss
Copy link
Contributor Author

knweiss commented Aug 23, 2017

Any thoughts on my comment regarding the cpu label values? This is something that should be fixed before node-exporter 1.0 - if you agree that it's an inconsistency worth fixing.

I can open a separate issue for this if you want.

@SuperQ
Copy link
Member

SuperQ commented Aug 24, 2017

Yes, please open an issue to talk about the cpu labels.

@rtreffer
Copy link
Contributor

Oh, the cpu0 -> 0 sounds like a good idea. I can also live with the lower cardinality, so given that it will reduce cardinality I'm in favor of that change.
Thank you for the PR and bringing this up!

@SuperQ
Copy link
Member

SuperQ commented Aug 24, 2017

For the cpu0 -> 0 change, I would like to do that as part of the planned rename of node_cpu to node_cpu_time_seconds.

@knweiss
Copy link
Contributor Author

knweiss commented Aug 24, 2017

I've opened issue #661 (cpu collector: Change cpu label values from "cpu0" to "0" ).

@knweiss
Copy link
Contributor Author

knweiss commented Aug 24, 2017

I've removed the cpu2/cpu3 fixture changes and added two minor improvements as separate commits. I've also rebased against master.

@SuperQ
Copy link
Member

SuperQ commented Sep 4, 2017

Can you add a cpu1 fixture to verify that the 2nd cpu in a node is ignored?
Like /sys/bus/node/devices/node0/cpu1/thermal_throttle/package_throttle_count. I think this makes sense.

'package_throttles_total' is per package, not per cpu. This also reduces
the total number of cpu time series a lot (esp for multi core cpus).
This file must be ignored by the cpu collector.
@knweiss
Copy link
Contributor Author

knweiss commented Sep 4, 2017

@SuperQ I've added the node 0 cpu1 fixture and rebased against master.

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

@SuperQ SuperQ merged commit b0d5c00 into prometheus:master Sep 7, 2017
@knweiss knweiss deleted the package_throttles_total branch September 8, 2017 14:08
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* cpu: Metric 'package_throttles_total' is per package.

'package_throttles_total' is per package, not per cpu. This also reduces
the total number of cpu time series a lot (esp for multi core cpus).

* cpu: Better handling of a cpulist edge-case.

* cpu: Extract the package number from the directory name.

Do not rely on the range index.

* cpu: Add package_throttle_count for node0 cpu1

This file must be ignored by the cpu collector.
tamcore pushed a commit to gitgrave/node_exporter that referenced this pull request Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants