prometheus / prometheus/node_exporter
Fibre Channel collector panics when sysfs statistics counters are missing
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 13.8k
- Forks
- 2.7k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 8
Description
Problem
The Fibre Channel collector can panic during a scrape when an FC host does not expose all expected statistics files under /sys/class/fc_host/<host>/statistics.
The procfs library represents unavailable counters as nil pointers, but the collector dereferences them unconditionally.
Panic
node_exporter[1070004]: panic: runtime error: invalid memory address or nil pointer dereference
node_exporter[1070004]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa2f259]
node_exporter[1070004]: goroutine 89 [running]:
node_exporter[1070004]: github.com/prometheus/node_exporter/collector.(*fibrechannelCollector).Update(0xc00014cf90, 0xc00037fd50)
node_exporter[1070004]: /Volumes/Home/go/node_exporter/collector/fibrechannel_linux.go:133 +0x479
node_exporter[1070004]: github.com/prometheus/node_exporter/collector.execute({0xc098f3, 0xc}, {0xd34e00, 0xc00014cf90}, 0xc00037fd50, 0xc00003e480)
node_exporter[1070004]: /Volumes/Home/go/node_exporter/collector/collector.go:160 +0x82
node_exporter[1070004]: github.com/prometheus/node_exporter/collector.NodeCollector.Collect.func1({0xc098f3?, 0x0?}, {0xd34e00?, 0xc00014cf90?})
node_exporter[1070004]: /Volumes/Home/go/node_exporter/collector/collector.go:151 +0x33
node_exporter[1070004]: created by github.com/prometheus/node_exporter/collector.NodeCollector.Collect in goroutine 60
node_exporter[1070004]: /Volumes/Home/go/node_exporter/collector/collector.go:150 +0xce
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in collector/fibrechannel_linux.go at line 133, where the Fibre Channel collector dereferences statistics counters. Check how missing files become nil pointers in the procfs data, then verify the collector handles an FC host with incomplete statistics without panicking during a scrape.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100