Skip to content

Commit b71fac4

Browse files
committed
Granular control for metric collection
We see an issue where a BMC is reporting 42+ ethernet interfaces and not returning any data for them. This is likely a bug in the BMC FW. This patch allows skipping the collection of certain groups of metrics to work around the bug. It adds an optional configuration section which can be used to control what is collected.
1 parent 8a6aca3 commit b71fac4

File tree

5 files changed

+294
-210
lines changed

5 files changed

+294
-210
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ groups:
1616
group1:
1717
username: group1_user
1818
password: group1_pass
19+
flakey:
20+
username: "Administrator"
21+
password: "Password"
22+
disabled_metrics:
23+
- "ethernet_interfaces"
1924
```
2025
Note that the ```default``` entry is useful as it avoids an error
2126
condition that is discussed in [this issue][2].
@@ -60,6 +65,35 @@ curl '127.0.0.1:9123/redfish?target=10.10.12.23&collectlogs=true'
6065

6166
The `collectlogs` query parameter can be included in Prometheus config.
6267

68+
## Disabling collection of specific groups of metrics
69+
70+
Sometimes it isn't possible to gather all metrics from a BMC because
71+
it doesn't conform to the Redfish standard due to a bug. Or perhaps
72+
you don't need all the metrics. In either case, basic support exists
73+
for skipping specific metric groups at the `default`, `group` or
74+
`host` level:
75+
76+
```yaml
77+
hosts:
78+
10.36.48.24:
79+
username: admin
80+
password: pass
81+
disabled_metrics:
82+
- "ethernet_interfaces"
83+
default:
84+
username: admin
85+
password: pass
86+
disabled_metrics:
87+
- "memory"
88+
- "processor"
89+
- "storage"
90+
- "pcie_devices"
91+
- "network_interfaces"
92+
- "ethernet_interfaces"
93+
- "simple_storage"
94+
- "pcie_functions"
95+
```
96+
6397
## Building
6498

6599
To build the redfish_exporter executable run the command:

collector/redfish_collector.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ type RedfishCollector struct {
4040
}
4141

4242
// NewRedfishCollector return RedfishCollector
43-
func NewRedfishCollector(host string, username string, password string, collectLogs bool, logger *log.Entry) *RedfishCollector {
43+
func NewRedfishCollector(host string, username string, password string, collectLogs bool, disabledMetrics []string, logger *log.Entry) *RedfishCollector {
4444
var collectors map[string]prometheus.Collector
4545
collectorLogCtx := logger
4646
redfishClient, err := newRedfishClient(host, username, password)
4747
if err != nil {
4848
collectorLogCtx.WithError(err).Error("error creating redfish client")
4949
} else {
5050
chassisCollector := NewChassisCollector(redfishClient, collectLogs, collectorLogCtx)
51-
systemCollector := NewSystemCollector(redfishClient, collectLogs, collectorLogCtx)
51+
systemCollector := NewSystemCollector(redfishClient, collectLogs, disabledMetrics, collectorLogCtx)
5252
managerCollector := NewManagerCollector(redfishClient, collectLogs, collectorLogCtx)
5353

5454
collectors = map[string]prometheus.Collector{"chassis": chassisCollector, "system": systemCollector, "manager": managerCollector}

0 commit comments

Comments
 (0)