protected void initFollowsFrom ( APMSpanBuilder builder , TraceRecorder recorder , Reference ref , ContextSampler sampler ) { APMSpan referenced = ( APMSpan ) ref . getReferredTo ( ) ; initTopLevelState ( referenced . getTraceContext ( ) . getTopSpan ( ) , recorder , sampler ) ; // Top level node in spawned fragment should be a Consumer with correlation id // referencing back to the 'spawned' node String nodeId = referenced . getNodePath ( ) ; getNodeBuilder ( ) . addCorrelationId ( new CorrelationIdentifier ( Scope . CausedBy , nodeId ) ) ; // Propagate trace id, transaction name and reporting level as creating a // separate trace fragment to represent the 'follows from' activity traceContext . initTraceState ( referenced . state ( ) ) ; makeInternalLink ( builder ) ; }
This method initialises the span based on a follows - from relationship .