Skip to content

Commit

Permalink
Don't populate empty labels for rpc_stats
Browse files Browse the repository at this point in the history
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
  • Loading branch information
Joe Handzik committed Jun 15, 2017
1 parent 95b81a8 commit 45e5e18
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sources/procfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,11 @@ func (s *lustreProcfsSource) Update(ch chan<- prometheus.Metric) (err error) {
}
case "brw_stats", "rpc_stats":
err = s.parseBRWStats(metric.source, "stats", path, directoryDepth, metric.helpText, metric.promName, metric.hasMultipleVals, func(nodeType string, brwOperation string, brwSize string, nodeName string, name string, helpText string, value uint64, extraLabel string, extraLabelValue string) {
ch <- metric.metricFunc([]string{nodeType, "operation", "size", extraLabel}, []string{nodeName, brwOperation, brwSize, extraLabelValue}, name, helpText, value)
if extraLabelValue == "" {
ch <- metric.metricFunc([]string{nodeType, "operation", "size"}, []string{nodeName, brwOperation, brwSize}, name, helpText, value)
} else {
ch <- metric.metricFunc([]string{nodeType, "operation", "size", extraLabel}, []string{nodeName, brwOperation, brwSize, extraLabelValue}, name, helpText, value)
}
})
if err != nil {
return err
Expand Down

0 comments on commit 45e5e18

Please # to comment.