Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix probe log when response if empty #1235

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
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
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