Merge pull request #83 from k0ste/help2

Reduced number of meta labels
This commit is contained in:
Ben Kochie 2022-10-14 10:18:32 +02:00 committed by GitHub
commit d3d5180048
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 156 deletions

View file

@ -51,9 +51,6 @@ var (
"Device capacity in blocks", "Device capacity in blocks",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -62,9 +59,6 @@ var (
"Device capacity in bytes", "Device capacity in bytes",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -73,9 +67,6 @@ var (
"Device block size", "Device block size",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
"blocks_type", "blocks_type",
}, },
nil, nil,
@ -85,9 +76,6 @@ var (
"Device interface speed, bits per second", "Device interface speed, bits per second",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
"speed_type", "speed_type",
}, },
nil, nil,
@ -97,9 +85,6 @@ var (
"Device attributes", "Device attributes",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
"attribute_name", "attribute_name",
"attribute_flags_short", "attribute_flags_short",
"attribute_flags_long", "attribute_flags_long",
@ -113,9 +98,6 @@ var (
"Device power on seconds", "Device power on seconds",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -124,9 +106,6 @@ var (
"Device rotation rate", "Device rotation rate",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -135,9 +114,6 @@ var (
"Device temperature celsius", "Device temperature celsius",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
"temperature_type", "temperature_type",
}, },
nil, nil,
@ -147,9 +123,6 @@ var (
"Device power cycle count", "Device power cycle count",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -158,9 +131,6 @@ var (
"Device write percentage used", "Device write percentage used",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -169,9 +139,6 @@ var (
"Normalized percentage (0 to 100%) of the remaining spare capacity available", "Normalized percentage (0 to 100%) of the remaining spare capacity available",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -180,9 +147,6 @@ var (
"When the Available Spare falls below the threshold indicated in this field, an asynchronous event completion may occur. The value is indicated as a normalized percentage (0 to 100%)", "When the Available Spare falls below the threshold indicated in this field, an asynchronous event completion may occur. The value is indicated as a normalized percentage (0 to 100%)",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -191,9 +155,6 @@ var (
"This field indicates critical warnings for the state of the controller", "This field indicates critical warnings for the state of the controller",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -202,9 +163,6 @@ var (
"Contains the number of occurrences where the controller detected an unrecovered data integrity error. Errors such as uncorrectable ECC, CRC checksum failure, or LBA tag mismatch are included in this field", "Contains the number of occurrences where the controller detected an unrecovered data integrity error. Errors such as uncorrectable ECC, CRC checksum failure, or LBA tag mismatch are included in this field",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -213,9 +171,6 @@ var (
"Contains the number of Error Information log entries over the life of the controller", "Contains the number of Error Information log entries over the life of the controller",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -224,9 +179,6 @@ var (
"", "",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -235,9 +187,6 @@ var (
"", "",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -246,9 +195,6 @@ var (
"General smart status", "General smart status",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -257,9 +203,6 @@ var (
"Exit status of smartctl on device", "Exit status of smartctl on device",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -268,9 +211,6 @@ var (
"Device state (0=active, 1=standby, 2=sleep, 3=dst, 4=offline, 5=sct)", "Device state (0=active, 1=standby, 2=sleep, 3=dst, 4=offline, 5=sct)",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -279,9 +219,6 @@ var (
"Device statistics", "Device statistics",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
"statistic_table", "statistic_table",
"statistic_name", "statistic_name",
"statistic_flags_short", "statistic_flags_short",
@ -294,9 +231,6 @@ var (
"Device status", "Device status",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
}, },
nil, nil,
) )
@ -305,9 +239,6 @@ var (
"Device SMART error log count", "Device SMART error log count",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
"error_log_type", "error_log_type",
}, },
nil, nil,
@ -317,9 +248,6 @@ var (
"Device SMART self test log count", "Device SMART self test log count",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
"self_test_log_type", "self_test_log_type",
}, },
nil, nil,
@ -329,9 +257,6 @@ var (
"Device SMART self test log error count", "Device SMART self test log error count",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
"self_test_log_type", "self_test_log_type",
}, },
nil, nil,
@ -341,9 +266,6 @@ var (
"Device SMART Error Recovery Control Seconds", "Device SMART Error Recovery Control Seconds",
[]string{ []string{
"device", "device",
"model_family",
"model_name",
"serial_number",
"op_type", "op_type",
}, },
nil, nil,

View file

@ -90,9 +90,6 @@ func (smart *SMARTctl) mineExitStatus() {
prometheus.GaugeValue, prometheus.GaugeValue,
smart.json.Get("smartctl.exit_status").Float(), smart.json.Get("smartctl.exit_status").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
@ -122,18 +119,12 @@ func (smart *SMARTctl) mineCapacity() {
prometheus.GaugeValue, prometheus.GaugeValue,
capacity.Get("blocks").Float(), capacity.Get("blocks").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
smart.ch <- prometheus.MustNewConstMetric( smart.ch <- prometheus.MustNewConstMetric(
metricDeviceCapacityBytes, metricDeviceCapacityBytes,
prometheus.GaugeValue, prometheus.GaugeValue,
capacity.Get("bytes").Float(), capacity.Get("bytes").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
for _, blockType := range []string{"logical", "physical"} { for _, blockType := range []string{"logical", "physical"} {
smart.ch <- prometheus.MustNewConstMetric( smart.ch <- prometheus.MustNewConstMetric(
@ -141,9 +132,6 @@ func (smart *SMARTctl) mineCapacity() {
prometheus.GaugeValue, prometheus.GaugeValue,
smart.json.Get(fmt.Sprintf("%s_block_size", blockType)).Float(), smart.json.Get(fmt.Sprintf("%s_block_size", blockType)).Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
blockType, blockType,
) )
} }
@ -158,9 +146,6 @@ func (smart *SMARTctl) mineInterfaceSpeed() {
prometheus.GaugeValue, prometheus.GaugeValue,
tSpeed.Get("units_per_second").Float()*tSpeed.Get("bits_per_unit").Float(), tSpeed.Get("units_per_second").Float()*tSpeed.Get("bits_per_unit").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
speedType, speedType,
) )
} }
@ -190,9 +175,6 @@ func (smart *SMARTctl) mineDeviceAttribute() {
prometheus.GaugeValue, prometheus.GaugeValue,
attribute.Get(path).Float(), attribute.Get(path).Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
name, name,
flagsShort, flagsShort,
flagsLong, flagsLong,
@ -210,9 +192,6 @@ func (smart *SMARTctl) minePowerOnSeconds() {
prometheus.CounterValue, prometheus.CounterValue,
GetFloatIfExists(pot, "hours", 0)*60*60+GetFloatIfExists(pot, "minutes", 0)*60, GetFloatIfExists(pot, "hours", 0)*60*60+GetFloatIfExists(pot, "minutes", 0)*60,
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
@ -224,9 +203,6 @@ func (smart *SMARTctl) mineRotationRate() {
prometheus.GaugeValue, prometheus.GaugeValue,
rRate, rRate,
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
} }
@ -240,9 +216,6 @@ func (smart *SMARTctl) mineTemperatures() {
prometheus.GaugeValue, prometheus.GaugeValue,
value.Float(), value.Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
key.String(), key.String(),
) )
return true return true
@ -256,9 +229,6 @@ func (smart *SMARTctl) minePowerCycleCount() {
prometheus.CounterValue, prometheus.CounterValue,
smart.json.Get("power_cycle_count").Float(), smart.json.Get("power_cycle_count").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
@ -270,9 +240,6 @@ func (smart *SMARTctl) mineDeviceSCTStatus() {
prometheus.GaugeValue, prometheus.GaugeValue,
status.Get("device_state").Float(), status.Get("device_state").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
} }
@ -283,9 +250,6 @@ func (smart *SMARTctl) minePercentageUsed() {
prometheus.CounterValue, prometheus.CounterValue,
smart.json.Get("nvme_smart_health_information_log.percentage_used").Float(), smart.json.Get("nvme_smart_health_information_log.percentage_used").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
@ -295,9 +259,6 @@ func (smart *SMARTctl) mineAvailableSpare() {
prometheus.CounterValue, prometheus.CounterValue,
smart.json.Get("nvme_smart_health_information_log.available_spare").Float(), smart.json.Get("nvme_smart_health_information_log.available_spare").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
@ -307,9 +268,6 @@ func (smart *SMARTctl) mineAvailableSpareThreshold() {
prometheus.CounterValue, prometheus.CounterValue,
smart.json.Get("nvme_smart_health_information_log.available_spare_threshold").Float(), smart.json.Get("nvme_smart_health_information_log.available_spare_threshold").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
@ -319,9 +277,6 @@ func (smart *SMARTctl) mineCriticalWarning() {
prometheus.CounterValue, prometheus.CounterValue,
smart.json.Get("nvme_smart_health_information_log.critical_warning").Float(), smart.json.Get("nvme_smart_health_information_log.critical_warning").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
@ -331,9 +286,6 @@ func (smart *SMARTctl) mineMediaErrors() {
prometheus.CounterValue, prometheus.CounterValue,
smart.json.Get("nvme_smart_health_information_log.media_errors").Float(), smart.json.Get("nvme_smart_health_information_log.media_errors").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
@ -343,9 +295,6 @@ func (smart *SMARTctl) mineNumErrLogEntries() {
prometheus.CounterValue, prometheus.CounterValue,
smart.json.Get("nvme_smart_health_information_log.num_err_log_entries").Float(), smart.json.Get("nvme_smart_health_information_log.num_err_log_entries").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
@ -356,9 +305,6 @@ func (smart *SMARTctl) mineBytesRead() {
prometheus.CounterValue, prometheus.CounterValue,
smart.json.Get("nvme_smart_health_information_log.data_units_read").Float()*blockSize, smart.json.Get("nvme_smart_health_information_log.data_units_read").Float()*blockSize,
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
@ -369,9 +315,6 @@ func (smart *SMARTctl) mineBytesWritten() {
prometheus.CounterValue, prometheus.CounterValue,
smart.json.Get("nvme_smart_health_information_log.data_units_written").Float()*blockSize, smart.json.Get("nvme_smart_health_information_log.data_units_written").Float()*blockSize,
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
@ -381,9 +324,6 @@ func (smart *SMARTctl) mineSmartStatus() {
prometheus.GaugeValue, prometheus.GaugeValue,
smart.json.Get("smart_status.passed").Float(), smart.json.Get("smart_status.passed").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
@ -418,9 +358,6 @@ func (smart *SMARTctl) mineDeviceStatistics() {
prometheus.GaugeValue, prometheus.GaugeValue,
statistic.Get("value").Float(), statistic.Get("value").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
"SATA PHY Event Counters", "SATA PHY Event Counters",
strings.TrimSpace(statistic.Get("name").String()), strings.TrimSpace(statistic.Get("name").String()),
"V---", "V---",
@ -447,9 +384,6 @@ func (smart *SMARTctl) mineDeviceStatus() {
prometheus.GaugeValue, prometheus.GaugeValue,
status.Get("passed").Float(), status.Get("passed").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
) )
} }
@ -460,9 +394,6 @@ func (smart *SMARTctl) mineDeviceErrorLog() {
prometheus.GaugeValue, prometheus.GaugeValue,
status.Get("count").Float(), status.Get("count").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
logType, logType,
) )
} }
@ -475,9 +406,6 @@ func (smart *SMARTctl) mineDeviceSelfTestLog() {
prometheus.GaugeValue, prometheus.GaugeValue,
status.Get("count").Float(), status.Get("count").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
logType, logType,
) )
smart.ch <- prometheus.MustNewConstMetric( smart.ch <- prometheus.MustNewConstMetric(
@ -485,9 +413,6 @@ func (smart *SMARTctl) mineDeviceSelfTestLog() {
prometheus.GaugeValue, prometheus.GaugeValue,
status.Get("error_count_total").Float(), status.Get("error_count_total").Float(),
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
logType, logType,
) )
} }
@ -500,9 +425,6 @@ func (smart *SMARTctl) mineDeviceERC() {
prometheus.GaugeValue, prometheus.GaugeValue,
status.Get("deciseconds").Float()/10.0, status.Get("deciseconds").Float()/10.0,
smart.device.device, smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
ercType, ercType,
) )
} }