Skip to content

Commit

Permalink
Merge pull request #18 from sensu/thoward/17/output_metrics_in_fixed_…
Browse files Browse the repository at this point in the history
…order

Output metrics in fixed order
  • Loading branch information
Caleb Hailey authored Oct 23, 2021
2 parents 0759638 + e77ca84 commit c06ba5a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,13 @@ func executeCheck(event *types.Event) (int, error) {
}()
metricGroups["disk.warning"].AddMetric(tags, anyWarning, timeNow)
if plugin.MetricsMode {
for _, g := range metricGroups {
g.Output()
}

// output metrics in a fixed order
metricGroups["disk.critical"].Output()
metricGroups["disk.warning"].Output()
metricGroups["disk.percent_used"].Output()
metricGroups["disk.total_bytes"].Output()
metricGroups["disk.used_bytes"].Output()
metricGroups["disk.free_bytes"].Output()
}
if criticals > 0 {
return sensu.CheckStateCritical, nil
Expand Down

0 comments on commit c06ba5a

Please sign in to comment.