Skip to content

Commit

Permalink
backup 3
Browse files Browse the repository at this point in the history
  • Loading branch information
sbueringer committed Feb 18, 2022
1 parent c1e09c3 commit 727062f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bootstrap/kubeadm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func main() {
}()
}

tp := traceutil.TraceProvider(tracingEndpoint, tracingSamplingRatePerMillion, "capi-controller-manager")
tp := traceutil.TraceProvider(tracingEndpoint, tracingSamplingRatePerMillion, "capi-kubeadm-bootstrap-controller-manager")

restConfig := ctrl.GetConfigOrDie()
restConfig.UserAgent = remote.DefaultClusterAPIUserAgent("cluster-api-kubeadm-bootstrap-manager")
Expand Down
2 changes: 1 addition & 1 deletion controlplane/kubeadm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func main() {
}()
}

tp := traceutil.TraceProvider(tracingEndpoint, tracingSamplingRatePerMillion, "capd-controller-manager")
tp := traceutil.TraceProvider(tracingEndpoint, tracingSamplingRatePerMillion, "capi-kubeadm-control-plane-controller-manager")

restConfig := ctrl.GetConfigOrDie()
restConfig.UserAgent = remote.DefaultClusterAPIUserAgent("cluster-api-kubeadm-control-plane-manager")
Expand Down
2 changes: 2 additions & 0 deletions internal/controllers/cluster/cluster_controller_phases.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ func (r *Reconciler) reconcileKubeconfig(ctx context.Context, cluster *clusterv1
ctx, span := r.Tracer.Start(ctx, "controllers.ClusterReconciler.reconcileKubeconfig")
defer span.End()
log := ctrl.LoggerFrom(ctx)
//log = log.WithValues("spanID", span.SpanContext().SpanID().String())
//ctx = ctrl.LoggerInto(ctx, log)

if !cluster.Spec.ControlPlaneEndpoint.IsValid() {
return ctrl.Result{}, nil
Expand Down
8 changes: 7 additions & 1 deletion util/trace/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ func (r *traceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ct
log = log.WithValues("traceID", span.SpanContext().TraceID().String())
ctx = ctrl.LoggerInto(ctx, log)

log.Info("Reconciliation started")

res, err := r.Reconciler.Reconcile(ctx, req)
if err != nil {
log.Error(err, "Error in reconcile")
log.Error(err, "Reconciliation finished with error")
span.SetAttributes(attribute.String("error", "true")) // FIXME:
} else {
log.Info("Reconciliation finished")
}

return res, err
}

Expand Down

0 comments on commit 727062f

Please sign in to comment.