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

Log duration on scrape failures #54

Merged
merged 1 commit into from
Oct 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,9 @@ func collect(ctx context.Context, client *client, organization org) ([]gaugeResu
for _, project := range projects.Projects {
start := time.Now()
issues, err := client.getIssues(organization.ID, project.ID)
duration := time.Since(start)
if err != nil {
log.Errorf("Failed to get issues for organization %s (%s) and project %s (%s): %v", organization.Name, organization.ID, project.Name, project.ID, err)
log.Errorf("Failed to get issues for organization %s (%s) and project %s (%s): duration %v: %v", organization.Name, organization.ID, project.Name, project.ID, duration, err)
continue
}
results := aggregateIssues(issues.Issues)
Expand All @@ -298,7 +299,6 @@ func collect(ctx context.Context, client *client, organization org) ([]gaugeResu
results: results,
isMonitored: project.IsMonitored,
})
duration := time.Since(start)
log.Debugf("Collected data in %v for %s %s", duration, project.ID, project.Name)
// stop right away in case of the context being cancelled. This ensures that
// we don't wait for a complete collect run for all projects before
Expand Down