private IContextSnapshot InternalCapture()
        {
            var refs = _segment.Refs;

            var snapshot =
                new ContextSnapshot(_segment.TraceSegmentId, ActiveSpan.SpanId, _segment.RelatedGlobalTraces);

            var metaValue = GetMetaValue(refs);

            snapshot.EntryApplicationInstanceId = metaValue.entryApplicationInstanceId;

            if (DictionaryUtil.IsNull(metaValue.operationId))
            {
                snapshot.EntryOperationName = metaValue.operationName;
            }
            else
            {
                snapshot.EntryOperationId = metaValue.operationId;
            }

            var parentSpan = _activeSpanStacks.Last();

            if (DictionaryUtil.IsNull(parentSpan.OperationId))
            {
                snapshot.ParentOperationName = parentSpan.OperationName;
            }
            else
            {
                snapshot.ParentOperationId = parentSpan.OperationId;
            }

            return(snapshot);
        }
        private IContextSnapshot InternalCapture(string activityId, string rootId)
        {
            var refs = _segment.Refs;

            var snapshot =
                new ContextSnapshot(_segment.TraceSegmentId, InternalActiveSpan(activityId).SpanId, _segment.RelatedGlobalTraces);

            var metaValue = GetMetaValue(refs, rootId);

            snapshot.EntryApplicationInstanceId = metaValue.entryApplicationInstanceId;

            if (metaValue.operationId == 0)
            {
                snapshot.EntryOperationName = metaValue.operationName;
            }
            else
            {
                snapshot.EntryOperationId = metaValue.operationId;
            }

            if (RootSpan(rootId).OperationId == 0)
            {
                snapshot.ParentOperationName = RootSpan(rootId).OperationName;
            }
            else
            {
                snapshot.ParentOperationId = RootSpan(rootId).OperationId;
            }

            return(snapshot);
        }