diff --git a/cmd/fastly-exporter/main.go b/cmd/fastly-exporter/main.go index 82953ac..4a5c708 100644 --- a/cmd/fastly-exporter/main.go +++ b/cmd/fastly-exporter/main.go @@ -254,13 +254,20 @@ func main() { } { - g, ctx := errgroup.WithContext(context.Background()) - g.Go(func() error { return serviceCache.Refresh(ctx) }) - g.Go(func() error { return datacenterCache.Refresh(ctx) }) - if err := g.Wait(); err != nil { - level.Error(apiLogger).Log("during", "initial API calls", "err", err) - os.Exit(1) - } + var g errgroup.Group + g.Go(func() error { + if err := serviceCache.Refresh(context.Background()); err != nil { + level.Warn(logger).Log("during", "initial fetch of service IDs", "err", err, "msg", "service metrics unavailable, will retry") + } + return nil + }) + g.Go(func() error { + if err := datacenterCache.Refresh(context.Background()); err != nil { + level.Warn(logger).Log("during", "initial fetch of datacenters", "err", err, "msg", "datacenter labels unavailable, will retry") + } + return nil + }) + g.Wait() } var defaultGatherers prometheus.Gatherers diff --git a/pkg/api/common.go b/pkg/api/common.go index c201964..ee9ca57 100644 --- a/pkg/api/common.go +++ b/pkg/api/common.go @@ -28,7 +28,7 @@ func NewError(resp *http.Response) *Error { // Error implements the error interface. func (e *Error) Error() string { var sb strings.Builder - sb.WriteString("api.fastly.com responded with") + sb.WriteString("api.fastly.com responded with ") sb.WriteString(http.StatusText(e.Code)) if e.Msg != "" { sb.WriteString(" (" + e.Msg + ")")