New Feature: use serial number instead of block handle for drive stats #1946
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.
Managing disk metrics indexed by a temporary block device name currently causes many issue:
This change solves these issues by using udevadm to look up the drive serial number to replace the block device handle if available. Before the change the output looks like this:
' # HELP node_disk_read_bytes_total The total number of bytes read successfully.'
' # TYPE node_disk_read_bytes_total counter'
node_disk_read_bytes_total{device="sda"} 2.2736896e+07
node_disk_read_bytes_total{device="sdb"} 2.2736896e+07
node_disk_read_bytes_total{device="dm-0"} 1.630419968e+09
node_disk_read_bytes_total{device="sr0"} 0
node_disk_read_bytes_total{device="vda"} 1.682236416e+09
'# HELP node_disk_read_time_seconds_total The total number of seconds spent by all reads.'
'# TYPE node_disk_read_time_seconds_total counter'
node_disk_read_time_seconds_total{device="sda"} 0.499
node_disk_read_time_seconds_total{device="sdb"} 0.518
node_disk_read_time_seconds_total{device="dm-0"} 130.733
node_disk_read_time_seconds_total{device="sr0"} 0
node_disk_read_time_seconds_total{device="vda"} 132.032
`
After the change the output looks like this:
'# HELP node_disk_read_bytes_total The total number of bytes read successfully.'
'# TYPE node_disk_read_bytes_total counter'
node_disk_read_bytes_total{device="HLN03000"} 2.2736896e+07
node_disk_read_bytes_total{device="HLN03002"} 2.2736896e+07
node_disk_read_bytes_total{device="dm-0"} 1.630419968e+09
node_disk_read_bytes_total{device="sr0"} 0
node_disk_read_bytes_total{device="vda"} 1.682236416e+09
'# HELP node_disk_read_time_seconds_total The total number of seconds spent by all reads.'
'# TYPE node_disk_read_time_seconds_total counter'
node_disk_read_time_seconds_total{device="HLN03000"} 0.499
node_disk_read_time_seconds_total{device="HLN03002"} 0.518
node_disk_read_time_seconds_total{device="dm-0"} 130.733
node_disk_read_time_seconds_total{device="sr0"} 0
node_disk_read_time_seconds_total{device="vda"} 132.032
Updating the test fixtures is not included yet waiting for general agreement to proceed with change.