Skip to content

Commit

Permalink
Merge pull request #95 from HewlettPackard/wip-fix-issue-94
Browse files Browse the repository at this point in the history
Don't populate empty labels for rpc_stats
  • Loading branch information
roclark authored Jun 15, 2017
2 parents 95b81a8 + 45e5e18 commit 392f16c
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 392f16c

Please # to comment.