Skip to content

Commit f992084

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 f992084

File tree

4 files changed

+260
-210
lines changed

4 files changed

+260
-210
lines changed

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)