Skip to content

Commit

Permalink
Verify nil values in prometheus.go
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspeitz committed May 9, 2018
1 parent 23b4c63 commit c7bf768
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions code/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ func createPrometheusMetrics(resources []*awsResource, cloudwatch []*cloudwatchD
}

for _, c := range cloudwatch {
metric := createCloudwatchMetric(*c)
registry.MustRegister(metric)
pushCounter.Inc()
if c.Value != nil {
metric := createCloudwatchMetric(*c)
registry.MustRegister(metric)
}
}

return registry
}

func createCloudwatchMetric(data cloudwatchData) prometheus.Gauge {
Expand Down

0 comments on commit c7bf768

Please sign in to comment.