src/trace-api.js
function createRootSpan_(api, options, skipFrames) {
  options = options || {};
  // If the options object passed in has the getTraceContext field set,
  // try to retrieve the header field containing incoming trace metadata.
  var incomingTraceContext;
  if (is.string(options.traceContext)) {
    incomingTraceContext = api.agent_.parseContextFromHeader(options.traceContext);
  }
  incomingTraceContext = incomingTraceContext || {};
  if (!api.agent_.shouldTrace(options, incomingTraceContext.options)) {
    cls.setRootContext(nullSpan);
    return null;
  }
  var rootContext = api.agent_.createRootSpanData(options.name,
    incomingTraceContext.traceId,
    incomingTraceContext.spanId,
    skipFrames + 1);
  return new RootSpan(api.agent_, rootContext);
}
function createRootSpan_(api, options, skipFrames) {
  options = options || {};
  // If the options object passed in has the getTraceContext field set,
  // try to retrieve the header field containing incoming trace metadata.
  var incomingTraceContext;
  if (is.string(options.traceContext)) {
    incomingTraceContext = api.agent_.parseContextFromHeader(options.traceContext);
  }
  incomingTraceContext = incomingTraceContext || {};
  if (!api.agent_.shouldTrace(options, incomingTraceContext.options)) {
    cls.setRootContext(nullSpan);
    return null;
  }
  var rootContext = api.agent_.createRootSpanData(options.name,
    incomingTraceContext.traceId,
    incomingTraceContext.spanId,
    skipFrames + 1);
  return new RootSpan(api.agent_, rootContext);
}
function createRootSpan_ ( api , options , skipFrames ) { options = options || { } ; // If the options object passed in has the getTraceContext field set, // try to retrieve the header field containing incoming trace metadata. var incomingTraceContext ; if ( is . string ( options . traceContext ) ) { incomingTraceContext = api . agent_ . parseContextFromHeader ( options . traceContext ) ; } incomingTraceContext = incomingTraceContext || { } ; if ( ! api . agent_ . shouldTrace ( options , incomingTraceContext . options ) ) { cls . setRootContext ( nullSpan ) ; return null ; } var rootContext = api . agent_ . createRootSpanData ( options . name , incomingTraceContext . traceId , incomingTraceContext . spanId , skipFrames + 1 ) ; return new RootSpan ( api . agent_ , rootContext ) ; }
Module-private functions
Module - private functions