Prefer device path based names over exported names#334
Merged
brian-brazil merged 2 commits intoprometheus:masterfrom Oct 28, 2016
Merged
Prefer device path based names over exported names#334brian-brazil merged 2 commits intoprometheus:masterfrom
brian-brazil merged 2 commits intoprometheus:masterfrom
Conversation
For some sensors (like coretemp) it is possible that multiple instances exist, thus base the name on the device path and not on the exported name.
Contributor
|
The end-to-end test needs updating. |
Member
|
Can we get a test for this please. At least update the end-to-end tests and include fixtures with two sensors. |
Contributor
Author
|
Arghs, yes, tested the wrong binary. Test with 2 coretemp sensors sounds like a good idea, will update. |
Explicitly have 2 coretemp instances with a symlink for the device such that the hwmon collector must pick that name (or fail)
Contributor
Author
|
I had to shuffle the hwmonX names a bit, coretemp.0/coretemp.1 will usually end up as hwmonX and hwmon(X+1). |
Contributor
|
Thanks! |
mcdan
pushed a commit
to mcdan/node_exporter
that referenced
this pull request
Nov 15, 2016
* Prefer device path based names over exported names For some sensors (like coretemp) it is possible that multiple instances exist, thus base the name on the device path and not on the exported name. * Update end-to-end test for dual socket machines Explicitly have 2 coretemp instances with a symlink for the device such that the hwmon collector must pick that name (or fail)
horazont
added a commit
to cloudandheat/node_exporter
that referenced
this pull request
Nov 28, 2016
The chip label generation has been changed in prometheus#334 to prefer the unique device path (e.g. the location on the PCI bus) due to prometheus#333. Here, a new label, chipName, is introduced which, again, carries the human-readable sensor name (e.g. coretemp). It is used in addition to the existing labels. This allows to mitigate the downsides of the solution to prometheus#333 (namely that the device path may not be stable across kernels and reboots) for cases where it does not matter that multiple devices may have the same human-readable name (e.g. aggregation or where at most one device of a type is present).
horazont
added a commit
to cloudandheat/node_exporter
that referenced
this pull request
Dec 1, 2016
The chip label generation has been changed in prometheus#334 to prefer the unique device path (e.g. the location on the PCI bus) due to prometheus#333. Here, a new annotation metric ``node_hwmon_chip_names`` is introduced which allows to link the unique chip sysfs path to a human-readable chip name which may not be unique among chip sysfs paths (for example, dual-slot systems have multiple chipType="coretemp" sensors). This allows to mitigate the downsides of the solution to prometheus#333 (namely that the device path may not be stable across kernels and reboots) for cases where it does not matter that multiple devices may have the same human-readable name (e.g. aggregation or where at most one device with a common chip name is present). For cases where no human-readable name can be derived, the annotation metric is not emitted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For some sensors (like coretemp) it is possible that multiple
instances exist, thus base the name on the device path and not on
the exported name.
@brian-brazil @SuperQ this will fix #333