public TraceSegmentReferenceRequest Transform()
        {
            TraceSegmentReferenceRequest traceSegmentReference = new TraceSegmentReferenceRequest();

            if (_type == SegmentRefType.CrossProcess)
            {
                traceSegmentReference.RefType        = (int)SegmentRefType.CrossProcess;
                traceSegmentReference.NetworkAddress = new StringOrIntValue(_peerId, _peerHost);
            }
            else
            {
                traceSegmentReference.RefType        = (int)SegmentRefType.CrossThread;
                traceSegmentReference.NetworkAddress = new StringOrIntValue();
            }

            traceSegmentReference.ParentApplicationInstanceId = _parentApplicationInstanceId;
            traceSegmentReference.EntryApplicationInstanceId  = _entryApplicationInstanceId;
            traceSegmentReference.ParentTraceSegmentId        = _traceSegmentId.Transform();
            traceSegmentReference.ParentSpanId = _spanId;

            traceSegmentReference.EntryServiceName = new StringOrIntValue(_entryOperationId, _entryOperationName);

            traceSegmentReference.ParentServiceName = new StringOrIntValue(_parentOperationId, _parentOperationName);

            return(traceSegmentReference);
        }
Example #2
0
        public TraceSegmentReferenceRequest Transform()
        {
            TraceSegmentReferenceRequest traceSegmentReference = new TraceSegmentReferenceRequest
            {
                TraceSegmentId        = _traceSegmentId,
                ParentApplicationCode = _parentApplicationCode,
                ParentOperationName   = _parentOperationName,
                ParentSpanId          = _spanId,
                EntryApplicationCode  = _entryApplicationCode,
                EntryOperationName    = _entryOperationName,
                NetworkAddress        = _peerAddress,
            };

            return(traceSegmentReference);
        }
        private static TraceSegmentReference MapToSegmentReference(TraceSegmentReferenceRequest referenceRequest)
        {
            var reference = new TraceSegmentReference
            {
                ParentApplicationInstanceId = referenceRequest.ParentApplicationInstanceId,
                EntryApplicationInstanceId  = referenceRequest.EntryApplicationInstanceId,
                ParentSpanId         = referenceRequest.ParentSpanId,
                RefType              = (RefType)referenceRequest.RefType,
                ParentTraceSegmentId = MapToUniqueId(referenceRequest.ParentTraceSegmentId)
            };

            ReadStringOrIntValue(reference, referenceRequest.NetworkAddress, NetworkAddressReader, NetworkAddressIdReader);
            ReadStringOrIntValue(reference, referenceRequest.EntryServiceName, EntryServiceReader, EntryServiceIdReader);
            ReadStringOrIntValue(reference, referenceRequest.ParentServiceName, ParentServiceReader, ParentServiceIdReader);

            return(reference);
        }