void () { runWithSpan(TelemetryManager.getInstance().getTracer(VcsScope), Operation.Checkout.getName(), (span) -> { StructuredIdeActivity checkoutActivity = CHECKOUT_ACTIVITY.started(myProject, () -> List.of( IS_BRANCH_PROTECTED.with(isBranchProtected()), IS_NEW_BRANCH.with(myNewBranch != null) )); Ref<Boolean> finishedSuccessfullyRef = Ref.create(false); span.setAttribute("branch", myNewBranch != null ? myNewBranch : "null"); try { finishedSuccessfullyRef.set(doExecute(checkoutActivity)); } finally { checkoutActivity.finished(() -> { return List.of(FINISHED_SUCCESSFULLY.with(finishedSuccessfullyRef.get())); }); } }); }