From 8b2649fcb4824314e40776c7a0bb164c5769a9e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20He=C3=9Felmann?= Date: Mon, 4 Sep 2023 12:53:39 +0200 Subject: [PATCH] chore: fix probe log when response if empty --- probe/pkg/probe/probe.go | 6 +++++- probe/pkg/runtime/runtime.go | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/probe/pkg/probe/probe.go b/probe/pkg/probe/probe.go index 7ff0d3e7ab..d395065d0c 100644 --- a/probe/pkg/probe/probe.go +++ b/probe/pkg/probe/probe.go @@ -144,7 +144,11 @@ func (p *ProbeImpl) createCentral(ctx context.Context) (*public.CentralRequest, } central, resp, err := p.fleetManagerPublicAPI.CreateCentral(ctx, true, request) defer utils.IgnoreError(closeBodyIfNonEmpty(resp)) - glog.Infof("creation of central instance (%s) requested", central.Id) + if central.Id == "" { + glog.Infof("creation of central instance requested - got empty response", central.Id) + } else { + glog.Infof("creation of central instance (%s) requested", central.Id) + } if err != nil { err = errors.WithMessage(err, extractCentralError(resp)) return nil, errors.Wrap(err, "creation of central instance failed") diff --git a/probe/pkg/runtime/runtime.go b/probe/pkg/runtime/runtime.go index e8d3aed969..646d6aaa5f 100644 --- a/probe/pkg/runtime/runtime.go +++ b/probe/pkg/runtime/runtime.go @@ -74,6 +74,7 @@ func (r *Runtime) RunSingle(ctx context.Context) (errReturn error) { if err := r.probe.Execute(probeRunCtx); err != nil { metrics.MetricsInstance().IncFailedRuns(r.Config.DataPlaneRegion) metrics.MetricsInstance().SetLastFailureTimestamp(r.Config.DataPlaneRegion) + glog.Error("probe run failed", err) return errors.Wrap(err, "probe run failed") } metrics.MetricsInstance().IncSucceededRuns(r.Config.DataPlaneRegion)