Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:rc-bullseye AS builder
FROM golang:1.24.2 AS builder

LABEL maintainer="Jennings Liu <jenningsloy318@gmail.com>"

Expand All @@ -17,7 +17,7 @@ RUN mkdir -p /go/src/github.com/ && \
cd /go/src/github.com/jenningsloy318/redfish_exporter && \
make build

FROM golang:rc-bullseye
FROM golang:1.24.2

COPY --from=builder /go/src/github.com/jenningsloy318/redfish_exporter/build/redfish_exporter /usr/local/bin/redfish_exporter
RUN mkdir /etc/prometheus
Expand Down
24 changes: 18 additions & 6 deletions collector/system_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,26 @@ func (s *SystemCollector) Collect(ch chan<- prometheus.Metric) {
} else if storages == nil {
systemLogContext.WithField("operation", "system.Storage()").Info("no storage data found")
} else {
processed := make(map[string]bool)
for _, storage := range storages {
if volumes, err := storage.Volumes(); err != nil {
systemLogContext.WithField("operation", "system.Volumes()").WithError(err).Error("error getting storage data from system")
} else {
wg3.Add(len(volumes))

for _, volume := range volumes {
_, exists := processed[volume.Name]
if exists {
systemLogContext.WithField("operation",
"system.Storage()").Info(fmt.Sprintf("Ignoring "+
"duplicate storage volume: %s. Please check whether this "+
"volume is returning duplicate data and report to the vendor.",
volume.Name))
wg3.Done()
continue
}
go parseVolume(ch, systemHostName, volume, wg3)
processed[volume.Name] = true
}
}

Expand Down Expand Up @@ -347,22 +359,22 @@ func (s *SystemCollector) Collect(ch chan<- prometheus.Metric) {
} else if simpleStorages == nil {
systemLogContext.WithField("operation", "system.SimpleStorages()").Info("no simple storage data found")
} else {
processed := make(map[string]bool)
processed := make(map[string]bool)
for _, simpleStorage := range simpleStorages {
devices := simpleStorage.Devices
wg8.Add(len(devices))
for _, device := range devices {
_, exists := processed[device.Name]
if exists {
systemLogContext.WithField("operation",
"system.SimpleStorages()").Info(fmt.Sprintf("Ignoring " +
"duplicate storage device: %s. Please check whether this " +
"device is returning duplicate data and report to the vendor.",
device.Name))
"system.SimpleStorages()").Info(fmt.Sprintf("Ignoring "+
"duplicate storage device: %s. Please check whether this "+
"device is returning duplicate data and report to the vendor.",
device.Name))
wg8.Done()
continue
}
go parseDevice(ch, systemHostName, device, wg8)
go parseDevice(ch, systemHostName, device, wg8)
processed[device.Name] = true
}
}
Expand Down