@Override public void execute(ILifecycleProgressMonitor monitor) throws SiteWhereException { monitor.pushContext(new LifecycleProgressContext(steps.size(), getName())); try { for (ILifecycleStep step : steps) { LOGGER.debug("Starting " + step.getName()); ActiveSpan span = monitor.getMicroservice().getTracer().activeSpan(); try { TracerUtils.logToSpan(span, "Starting step '" + step.getName() + "'."); monitor.startProgress(step.getName()); step.execute(monitor); monitor.finishProgress(); } catch (SiteWhereException e) { TracerUtils.handleErrorInTracerSpan(span, e); throw e; } catch (Throwable t) { SiteWhereException e = new SiteWhereException("Unhandled exception in composite lifecycle step.", t); TracerUtils.handleErrorInTracerSpan(span, e); throw e; } } } finally { monitor.popContext(); } }