Skip to content

Commit

Permalink
return if failed describing TrustedAdbisor check
Browse files Browse the repository at this point in the history
  • Loading branch information
shamil committed Sep 19, 2019
1 parent 3a20e86 commit 837fb39
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
0.1.1
3 changes: 2 additions & 1 deletion collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ func (c *Collector) scrape(ch chan<- prometheus.Metric) {
if err != nil {
log.With("err", err).Errorf("failed describing TrustedAdbisor check")
scrapeError.Set(1)
return
}

for _, d := range result.FlaggedResources {
Expand All @@ -116,7 +117,6 @@ func (c *Collector) scrape(ch chan<- prometheus.Metric) {
}

if time.Now().After(c.nextRefreshTime) {
log.Info("refreshing TrustedAdvisor check...")
result, err := c.awsSupport.RefreshtS3BucketPermissionsCheck()

if err != nil {
Expand All @@ -125,6 +125,7 @@ func (c *Collector) scrape(ch chan<- prometheus.Metric) {
}

c.nextRefreshTime = time.Now().Add(time.Duration(*result.MillisUntilNextRefreshable) * time.Millisecond)
log.Infof("refreshed TrustedAdvisor check, next refresh after %v", c.nextRefreshTime.Format("2 Jan 2006 15:04:05"))
}
}

Expand Down
2 changes: 1 addition & 1 deletion exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ func main() {
</html>`))
})

log.Infoln("Listening on", *listenAddress)
log.Infoln("listening on", *listenAddress)
log.Fatal(http.ListenAndServe(*listenAddress, nil))
}

0 comments on commit 837fb39

Please sign in to comment.