Skip to content

Commit

Permalink
chore: fix probe log when response if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
stehessel committed Sep 4, 2023
1 parent 63189b2 commit 8b2649f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion probe/pkg/probe/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions probe/pkg/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8b2649f

Please sign in to comment.