Skip to content
This repository was archived by the owner on Aug 9, 2023. It is now read-only.

Commit 2ce9d6d

Browse files
author
Bjørn
authored
Add logging of the exporters polling activity (#45)
Currently it is not possible to see from the logs that the polling mechanism is running. This changes a debug log to info along with adding a couple of result logs for each polling run.
1 parent 06d535f commit 2ce9d6d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

main.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func runAPIPolling(done chan error, url, token string, organizationIDs []string,
144144
for {
145145
var gaugeResults []gaugeResult
146146
for _, organization := range organizations {
147-
log.Debugf("Collecting for organization '%s'", organization.Name)
147+
log.Infof("Collecting for organization '%s'", organization.Name)
148148
results, err := collect(&client, organization)
149149
if err != nil {
150150
log.With("error", errors.Unwrap(err)).
@@ -153,8 +153,10 @@ func runAPIPolling(done chan error, url, token string, organizationIDs []string,
153153
Errorf("Collection failed for organization '%s': %v", organization.Name, err)
154154
continue
155155
}
156+
log.Infof("Recorded %d results for organization '%s'", len(results), organization.Name)
156157
gaugeResults = append(gaugeResults, results...)
157158
}
159+
log.Infof("Exposing %d results as metrics", len(gaugeResults))
158160
scrapeMutex.Lock()
159161
register(gaugeResults)
160162
scrapeMutex.Unlock()

0 commit comments

Comments
 (0)