Skip to content

Commit

Permalink
Merge pull request #60 from iits-consulting/Ninja243/no-panic-on-batc…
Browse files Browse the repository at this point in the history
…h-fail

Don't panic if batch download request fails
  • Loading branch information
Ninja243 authored Jan 16, 2025
2 parents 74859b6 + eb9195c commit 8950fce
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ func collectMetricsInBackground(config internal.ConfigStruct, logger internal.IL
logger.Info("Prometheus metrics initiated!")

for {
batchedMetricsResponse, err := client.GetMetricDataBatched(filteredMetrics)
if err != nil {
logger.Panic("Unable to retrieve batched metric data", "error", err)
batchedMetricsResponse, getMetricErr := client.GetMetricDataBatched(filteredMetrics)
if getMetricErr != nil {
logger.Error("Unable to retrieve batched metric data", "error", getMetricErr)
time.Sleep(config.WaitDuration)
continue
}

logger.Info("Batch metrics retrieved.")
Expand Down

0 comments on commit 8950fce

Please sign in to comment.