Repository navigation
Fix fibrechannel_linux for ppc64le - #3769
Conversation
| // Note: `procfs` does not guarantee a safe dereference for these counters. | ||
| // A disabled host returns no statistics counters. | ||
| if host.PortState == nil || *host.PortState == "Unknown" { | ||
| // Note: These are not guaranteed to exist in the filesystem |
There was a problem hiding this comment.
This defense addition makes sense to me.
|
Related to a bug found at https://redhat.atlassian.net/browse/OCPBUGS-100376 |
e4442c4 to
597d541
Compare
597d541 to
ae10239
Compare
32870c9 to
d00fb6f
Compare
| # TYPE node_fibrechannel_info gauge | ||
| node_fibrechannel_info{dev_loss_tmo="",fabric_name="",fc_host="host1",port_id="",port_name="",port_state="Online",port_type="",speed="8 Gbit",supported_classes="",supported_speeds="",symbolic_name=""} 1 | ||
| node_fibrechannel_info{dev_loss_tmo="30",fabric_name="0",fc_host="host0",port_id="000002",port_name="1000e0071bce95f2",port_state="Online",port_type="Point-To-Point (direct nport connection)",speed="16 Gbit",supported_classes="Class 3",supported_speeds="4 Gbit, 8 Gbit, 16 Gbit",symbolic_name="Emulex SN1100E2P FV12.4.270.3 DV12.4.0.0. HN:gotest. OS:Linux"} 1 | ||
| node_fibrechannel_info{dev_loss_tmo="30",fabric_name="0",fc_host="host2",port_id="000003",port_name="4000e0071bce95f2",port_state="Online",port_type="Point-To-Point (direct nport connection)",speed="16 Gbit",supported_classes="Class 3",supported_speeds="4 Gbit, 8 Gbit, 16 Gbit",symbolic_name="Emulex SN1100E2P FV12.4.270.3 DV12.4.0.0. HN:gotest. OS:Linux"} 1 |
There was a problem hiding this comment.
this info metric isn't correct (most of the label values are empty)
There was a problem hiding this comment.
Isn't that the whole point of this PR?
There was a problem hiding this comment.
The expected output is
node_fibrechannel_info{dev_loss_tmo="",fabric_name="",fc_host="host1",port_id="",port_name="",port_state="Online",port_type="",speed="8 Gbit",supported_classes="",supported_speeds="",symbolic_name=""} 1
node_fibrechannel_info{dev_loss_tmo="",fabric_name="",fc_host="host2",port_id="",port_name="",port_state="Online",port_type="",speed="",supported_classes="",supported_speeds="",symbolic_name=""} 1
node_fibrechannel_info{dev_loss_tmo="30",fabric_name="0",fc_host="host0",port_id="000002",port_name="1000e0071bce95f2",port_state="Online",port_type="Point-To-Point (direct nport connection)",speed="16 Gbit",supported_classes="Class 3",supported_speeds="4 Gbit, 8 Gbit, 16 Gbit",symbolic_name="Emulex SN1100E2P FV12.4.270.3 DV12.4.0.0. HN:gotest. OS:Linux"} 1
instead of
node_fibrechannel_info{dev_loss_tmo="",fabric_name="",fc_host="host1",port_id="",port_name="",port_state="Online",port_type="",speed="8 Gbit",supported_classes="",supported_speeds="",symbolic_name=""} 1
node_fibrechannel_info{dev_loss_tmo="30",fabric_name="0",fc_host="host0",port_id="000002",port_name="1000e0071bce95f2",port_state="Online",port_type="Point-To-Point (direct nport connection)",speed="16 Gbit",supported_classes="Class 3",supported_speeds="4 Gbit, 8 Gbit, 16 Gbit",symbolic_name="Emulex SN1100E2P FV12.4.270.3 DV12.4.0.0. HN:gotest. OS:Linux"} 1
node_fibrechannel_info{dev_loss_tmo="30",fabric_name="0",fc_host="host2",port_id="000003",port_name="4000e0071bce95f2",port_state="Online",port_type="Point-To-Point (direct nport connection)",speed="16 Gbit",supported_classes="Class 3",supported_speeds="4 Gbit, 8 Gbit, 16 Gbit",symbolic_name="Emulex SN1100E2P FV12.4.270.3 DV12.4.0.0. HN:gotest. OS:Linux"} 1
Notice how the host2 line is between host1 and host0 and how most of its labels are empty.
There was a problem hiding this comment.
I still don't understand what the problem is. The testcase reproduces the problem without the fix and everything passes with the fix.
Can you just provide a patch for whatever it is you are unhappy with?
There was a problem hiding this comment.
I appreciate it, thanks!
d135cd5 to
6a190da
Compare
|
@simonpasquier What is the next step in the process? |
jan--f
left a comment
There was a problem hiding this comment.
The changes in collector/fixtures/sys.ttar look a bit messy and it's hard to distinguish what is really required for this change. Some parts of the diff seems to just reorder content.
Is that needed or can that reordering be dropped?
|
This project doesn't seem to have the proper toolset to support just targeted additions. to components. Can you provide some help in this area? I guess what needs to happen is to uncompress the tarball and then git checkout files? But I always feel uncomfortable performing manual changes on a critical component. |
|
|
5da60cd to
1327261
Compare
Seen on a master node: ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x106cefa4] goroutine 81 [running]: github.com/prometheus/node_exporter/collector.(*fibrechannelCollector).Update(0x7e28c1ae20f0, 0x7e28c1826770) /go/src/github.com/prometheus/node_exporter/collector/fibrechannel_linux.go:133 +0x604 sh-5.1# ls -l /host/sys/class/fc_host/ total 0 lrwxrwxrwx. 1 root root 0 Jul 30 20:42 host1 -> ../../devices/vio/30000003/host1/fc_host/host1 lrwxrwxrwx. 1 root root 0 Jul 30 20:42 host2 -> ../../devices/vio/30000005/host2/fc_host/host2 sh-5.1# ls -l /host/sys/class/fc_host/host1/ total 0 -rw-r--r--. 1 root root 65536 Jul 30 20:09 dev_loss_tmo lrwxrwxrwx. 1 root root 0 Jul 30 20:42 device -> ../../../host1 -r--r--r--. 1 root root 65536 Jul 30 20:09 fabric_name --w-------. 1 root root 65536 Jul 30 20:42 issue_lip -r--r--r--. 1 root root 65536 Jul 30 20:42 maxframe_size -r--r--r--. 1 root root 65536 Jul 30 20:09 node_name -r--r--r--. 1 root root 65536 Jul 30 20:09 port_id -r--r--r--. 1 root root 65536 Jul 30 20:42 port_name -r--r--r--. 1 root root 65536 Jul 30 20:09 port_state -r--r--r--. 1 root root 65536 Jul 30 20:09 port_type drwxr-xr-x. 2 root root 0 Jul 30 20:42 power -r--r--r--. 1 root root 65536 Jul 30 20:09 speed lrwxrwxrwx. 1 root root 0 Jul 30 20:42 subsystem -> ../../../../../../class/fc_host -r--r--r--. 1 root root 65536 Jul 30 20:09 supported_classes -rw-r--r--. 1 root root 65536 Jul 30 20:42 tgtid_bind_type -rw-r--r--. 1 root root 65536 Jul 30 20:42 uevent ``` Since many filenames for counters are not guaranteed to exist in VMs, allocate if not present. Signed-off-by: Mark Hamzy <hamzy@us.ibm.com>
1327261 to
b6f1721
Compare
Seen on a master node: ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x106cefa4] goroutine 81 [running]: github.com/prometheus/node_exporter/collector.(*fibrechannelCollector).Update(0x7e28c1ae20f0, 0x7e28c1826770) /go/src/github.com/prometheus/node_exporter/collector/fibrechannel_linux.go:133 +0x604 sh-5.1# ls -l /host/sys/class/fc_host/ total 0 lrwxrwxrwx. 1 root root 0 Jul 30 20:42 host1 -> ../../devices/vio/30000003/host1/fc_host/host1 lrwxrwxrwx. 1 root root 0 Jul 30 20:42 host2 -> ../../devices/vio/30000005/host2/fc_host/host2 sh-5.1# ls -l /host/sys/class/fc_host/host1/ total 0 -rw-r--r--. 1 root root 65536 Jul 30 20:09 dev_loss_tmo lrwxrwxrwx. 1 root root 0 Jul 30 20:42 device -> ../../../host1 -r--r--r--. 1 root root 65536 Jul 30 20:09 fabric_name --w-------. 1 root root 65536 Jul 30 20:42 issue_lip -r--r--r--. 1 root root 65536 Jul 30 20:42 maxframe_size -r--r--r--. 1 root root 65536 Jul 30 20:09 node_name -r--r--r--. 1 root root 65536 Jul 30 20:09 port_id -r--r--r--. 1 root root 65536 Jul 30 20:42 port_name -r--r--r--. 1 root root 65536 Jul 30 20:09 port_state -r--r--r--. 1 root root 65536 Jul 30 20:09 port_type drwxr-xr-x. 2 root root 0 Jul 30 20:42 power -r--r--r--. 1 root root 65536 Jul 30 20:09 speed lrwxrwxrwx. 1 root root 0 Jul 30 20:42 subsystem -> ../../../../../../class/fc_host -r--r--r--. 1 root root 65536 Jul 30 20:09 supported_classes -rw-r--r--. 1 root root 65536 Jul 30 20:42 tgtid_bind_type -rw-r--r--. 1 root root 65536 Jul 30 20:42 uevent ``` Since many filenames for counters are not guaranteed to exist in VMs, allocate if not present. Signed-off-by: Mark Hamzy <hamzy@us.ibm.com>
OCPBUGS-100376: cherry-pick 24c6dce - Fix fibrechannel_linux for ppc64le (prometheus#3769)
Seen on a master node: ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x106cefa4] goroutine 81 [running]: github.com/prometheus/node_exporter/collector.(*fibrechannelCollector).Update(0x7e28c1ae20f0, 0x7e28c1826770) /go/src/github.com/prometheus/node_exporter/collector/fibrechannel_linux.go:133 +0x604 sh-5.1# ls -l /host/sys/class/fc_host/ total 0 lrwxrwxrwx. 1 root root 0 Jul 30 20:42 host1 -> ../../devices/vio/30000003/host1/fc_host/host1 lrwxrwxrwx. 1 root root 0 Jul 30 20:42 host2 -> ../../devices/vio/30000005/host2/fc_host/host2 sh-5.1# ls -l /host/sys/class/fc_host/host1/ total 0 -rw-r--r--. 1 root root 65536 Jul 30 20:09 dev_loss_tmo lrwxrwxrwx. 1 root root 0 Jul 30 20:42 device -> ../../../host1 -r--r--r--. 1 root root 65536 Jul 30 20:09 fabric_name --w-------. 1 root root 65536 Jul 30 20:42 issue_lip -r--r--r--. 1 root root 65536 Jul 30 20:42 maxframe_size -r--r--r--. 1 root root 65536 Jul 30 20:09 node_name -r--r--r--. 1 root root 65536 Jul 30 20:09 port_id -r--r--r--. 1 root root 65536 Jul 30 20:42 port_name -r--r--r--. 1 root root 65536 Jul 30 20:09 port_state -r--r--r--. 1 root root 65536 Jul 30 20:09 port_type drwxr-xr-x. 2 root root 0 Jul 30 20:42 power -r--r--r--. 1 root root 65536 Jul 30 20:09 speed lrwxrwxrwx. 1 root root 0 Jul 30 20:42 subsystem -> ../../../../../../class/fc_host -r--r--r--. 1 root root 65536 Jul 30 20:09 supported_classes -rw-r--r--. 1 root root 65536 Jul 30 20:42 tgtid_bind_type -rw-r--r--. 1 root root 65536 Jul 30 20:42 uevent ``` Since many filenames for counters are not guaranteed to exist in VMs, allocate if not present. Signed-off-by: Mark Hamzy <hamzy@us.ibm.com>
…84-to-release-5.0 [release-5.0] OCPBUGS-112719: cherry-pick 24c6dce - Fix fibrechannel_linux for ppc64le (prometheus#3769)
The behavior of `node_cpu_frequency_hertz` has changed. There are two different sources of data for this metric. One from the `cpu` collector, one from the `cpufreq` collector. Due to historical feature migrations the `cpufreq` collector shares the same subsystem as the `cpu` collector. This caused conflicting data behavior. An attempt to fix this was introduced in #3318. This behavior has been reverted to the previous behavior in #3795. A new flag (`--collector.cpufreq.enable-cpufreq-prefix`) has been introduced that gives the `cpufreq` a dedicated metric name subsystem (`node_cpufreq_...`). This will likely be the default in v2. * [CHANGE] netstat: Use procfs parsers for netstat, snmp and snmp6 #3796 * [CHANGE] edac: Fix no data results #3863 * [CHANGE] nvme: Deprecate metric nvme_namespace_capacity_bytes #3899 * [FEATURE] Add tainted collector for /proc/sys/kernel/tainted #3745 * [FEATURE] Add resctrl collector #3797 * [ENHANCEMENT] netstat: Add new FreeBSD metrics #3334 * [ENHANCEMENT] Add `chip` label to DRM metrics #3572 * [ENHANCEMENT] diskstats: add device-mapper backing device info metric #3676 * [ENHANCEMENT] textfile: support UTF-8 metric and label names #3729 * [ENHANCEMENT] ksmd: add general_profit metric #3778 #3894 * [BUGFIX] edac: Fix printf-style formatting in slog call #3759 * [BUGFIX] fibre_channel: fix crash when attempting to dereference invalid counters #3573 * [BUGFIX] thermal: Fix collecting Darwin temperatures without CPU power status #3767 * [BUGFIX] fibrechannel: Fix for ppc64le #3769 * [BUGFIX] cpu: Revert dup cpu frequency, add node_cpufreq flag #3795 * [BUGFIX] infiniband: skip sysfs reads for excluded devices #3824 * [BUGFIX] bcache: Fix btree_read_average_duration_seconds unit #3828 Signed-off-by: Ben Kochie <superq@gmail.com>
Seen on a master node:
Since many filenames for counters are not guaranteed to exist in VMs, allocate if not present.