/// <summary>
        /// Invokes a simple remote call asynchronously.
        /// </summary>
        public override AsyncUnaryCall <TResponse> AsyncUnaryCall <TRequest, TResponse>(Method <TRequest, TResponse> method, string host, CallOptions options, TRequest request)
        {
            var trace = this.ResolveTraceSpan().Child();

            trace.Record(Annotations.ClientSend());
            trace.Record(Annotations.ServiceName(_serviceName));
            trace.Record(Annotations.Rpc("grpc"));

            var channel = new Channel(_target, ChannelCredentials.Insecure);
            var call    = CreateCall(channel, method, host, options, trace);

            try
            {
                trace.Record(Annotations.Tag("grpc.host", _target));
                trace.Record(Annotations.Tag("grpc.request", JsonConvert.SerializeObject(request)));
                var response = Calls.AsyncUnaryCall(call, request);
                trace.Record(Annotations.Tag("grpc.response", JsonConvert.SerializeObject(response)));
                return(response);
            }
            finally
            {
                trace.Record(Annotations.ClientRecv());
                channel.ShutdownAsync();
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> PostFlickrImage()
        {
            PhotoSearchOptions photoSearchOptions = new PhotoSearchOptions
            {
                // See for List of Available Machine Tags
                //https://api-attractions.navigatorglass.com/swagger/#!/MachineKey/ApiMachineKeyPredicatesGet

                MachineTags = "machine_tags => nycparks:",
                //MachineTags = "machine_tags => nychalloffame:",
                //MachineTags = "machine_tags => nycparks:m010=",
                //MachineTags = "machine_tags => nycparks:m089=",
                //MachineTags = "machine_tags => nycparks:q436=",
                // MachineTags = "machine_tags => nycparks:m010=114",
                // UserId = "",
                //PhotoSize = "q",   //150x150
                //PhotoSize = "z",   // Medium 640
                //PhotoSize = "q", //width="1024" height="768
            };

            Log.Information("Begin Zipkin Trace Here");
            _trace.Record(Annotations.ClientSend());
            _trace.Record(Annotations.ServiceName("FlickrSearch:PostFlickrImage"));
            _trace.Record(Annotations.Rpc("Post"));
            var photos = await _flickrSearchService.SearchPhotosAsync(photoSearchOptions);

            _trace.Record(Annotations.ClientRecv());
            _logger.LogInformation("Total Photos:{PhotoCount}", photos.Count);


            HttpContext.Response.Headers.Add("Access-Control-Expose-Headers", "X-InlineCount");
            HttpContext.Response.Headers.Add("X-InlineCount", photos.Count.ToString(CultureInfo.InvariantCulture));
            return(Ok(photos));
        }
Exemplo n.º 3
0
 public void DurationAndSpanStartedSetWhenSetAsComplete()
 {
     VerifySpanDurationComputedWhenSetAsComplete(Annotations.ClientSend(), Annotations.ClientRecv(), isRootSpan: false, isSpanStartedAndDurationSet: true);
     VerifySpanDurationComputedWhenSetAsComplete(Annotations.ServerRecv(), Annotations.ServerSend(), isRootSpan: true, isSpanStartedAndDurationSet: true);
     VerifySpanDurationComputedWhenSetAsComplete(Annotations.ServerRecv(), Annotations.ServerSend(), isRootSpan: false, isSpanStartedAndDurationSet: false);
     VerifySpanDurationComputedWhenSetAsComplete(Annotations.LocalOperationStart("Operation"), Annotations.LocalOperationStop(), isRootSpan: false, isSpanStartedAndDurationSet: true);
 }
Exemplo n.º 4
0
 public TracingTimer(Trace trace, string tracingServiceName, string methodName)
 {
     _trace = trace;
     _trace.Record(Annotations.ServiceName(tracingServiceName));
     _trace.Record(Annotations.ClientSend());
     _trace.Record(Annotations.Rpc($"{tracingServiceName}_{methodName}"));
 }
Exemplo n.º 5
0
        public void SpansAreLoggedAfterEndAnnotationClientRecv()
        {
            var trace = Trace.Create();

            Record(trace, Annotations.ClientSend());
            Record(trace, Annotations.ClientRecv());

            _reporter.Verify(r => r.Report(It.IsAny <Span>()), Times.Once());
        }
Exemplo n.º 6
0
        public void SpansAreLoggedAfterEndAnnotationClientRecv()
        {
            var trace = Trace.Create();

            Record(trace, Annotations.ClientSend());
            Record(trace, Annotations.ClientRecv());

            _spanSerializer.Verify(s => s.SerializeTo(It.IsAny <Stream>(), It.IsAny <Span>()), Times.Once());
            _spanSender.Verify(sender => sender.Send(It.IsAny <byte[]>()), Times.Once());
        }
Exemplo n.º 7
0
 public void SimpleAnnotationsCorrectlyAdded()
 {
     AnnotationCorrectlyAdded(Annotations.ClientSend(), zipkinCoreConstants.CLIENT_SEND, false, false);
     AnnotationCorrectlyAdded(Annotations.ClientRecv(), zipkinCoreConstants.CLIENT_RECV, false, true);
     AnnotationCorrectlyAdded(Annotations.ServerRecv(), zipkinCoreConstants.SERVER_RECV, false, false);
     AnnotationCorrectlyAdded(Annotations.ServerSend(), zipkinCoreConstants.SERVER_SEND, false, true);
     AnnotationCorrectlyAdded(Annotations.WireRecv(), zipkinCoreConstants.WIRE_RECV, false, false);
     AnnotationCorrectlyAdded(Annotations.WireSend(), zipkinCoreConstants.WIRE_SEND, false, false);
     AnnotationCorrectlyAdded(Annotations.LocalOperationStart("Operation"), zipkinCoreConstants.LOCAL_COMPONENT, true, false);
 }
Exemplo n.º 8
0
        public void SpanDoesntHaveDurationIfIncomplete()
        {
            const int offset = 10;

            Assert.False(GetSpanDuration(offset, Annotations.ServerRecv()).HasValue);
            Assert.False(GetSpanDuration(offset, Annotations.ServerSend()).HasValue);
            Assert.False(GetSpanDuration(offset, Annotations.ClientRecv()).HasValue);
            Assert.False(GetSpanDuration(offset, Annotations.ClientSend()).HasValue);
            Assert.False(GetSpanDuration(offset, Annotations.LocalOperationStart("Operation")).HasValue);
            Assert.False(GetSpanDuration(offset, Annotations.LocalOperationStop()).HasValue);
        }
Exemplo n.º 9
0
        public TransmissionResult Call()
        {
            Trace span = Trace.Create();

            span.Record(Annotations.ServiceName("standalone"));
            span.Record(Annotations.ClientSend());

            try
            {
                ITransmissionResponse transmissionResponse;
                long duration = 0;

                if (this.parameters.UseFactory)
                {
                    using (Stream inputStream = File.Open(this.xmlPayloadFile.FullName, FileMode.Open, FileAccess.Read))
                    {
                        transmissionResponse = this.parameters.HyperwayOutboundComponent.GetTransmissionService()
                                               .Send(inputStream, span);
                    }
                }
                else
                {
                    ITransmissionRequest transmissionRequest = this.CreateTransmissionRequest(span);

                    ITransmitter transmitter;
                    Trace        span1 = span.Child();
                    span1.Record(Annotations.ServiceName("get transmitter"));
                    span1.Record(Annotations.ClientSend());
                    try
                    {
                        transmitter = this.parameters.HyperwayOutboundComponent.GetTransmitter();
                    }
                    finally
                    {
                        span1.Record(Annotations.ClientRecv());
                    }

                    // Performs the transmission
                    var watch = new Stopwatch();
                    watch.Start();
                    transmissionResponse = this.PerformTransmission(
                        this.parameters.EvidencePath, transmitter, transmissionRequest, span);
                    watch.Stop();

                    return(new TransmissionResult(watch.ElapsedMilliseconds, transmissionResponse.GetTransmissionIdentifier()));
                }

                return(new TransmissionResult(duration, transmissionResponse.GetTransmissionIdentifier()));
            }
            finally
            {
                span.Record(Annotations.ClientRecv());
            }
        }
Exemplo n.º 10
0
 /// <summary>
 /// 创建一个客户端监控
 /// </summary>
 /// <param name="serviceName">服务名称</param>
 /// <param name="operation">操作</param>
 public ClientTrace(string serviceName, string operation)
 {
     this.Trace        = Unity.Get().Child();
     this.RecordEvent += () =>
     {
         this.Trace.Record(Annotations.ClientSend(), this._beginDate);
         this.Trace.Record(Annotations.ServiceName(serviceName), this._beginDate);
         this.Trace.Record(Annotations.Rpc(operation), this._beginDate);
         this.Trace.Record(Annotations.ClientAddr(SerializerUtils.DefaultEndPoint), this._beginDate);
     };
 }
Exemplo n.º 11
0
        public static void RecordAnnotation(Trace trace, ZKAnnotations annotationType, String serviceName = null, string requestType = null)
        {
            switch (annotationType)
            {
            case ZKAnnotations.CS:
                trace.Record(Annotations.ClientSend());
                if (!String.IsNullOrEmpty(serviceName))
                {
                    trace.Record(Annotations.ServiceName(serviceName));
                }
                if (!String.IsNullOrEmpty(requestType))
                {
                    trace.Record(Annotations.Rpc("GET"));
                }
                break;

            case ZKAnnotations.CR:
                trace.Record(Annotations.ClientRecv());
                if (!String.IsNullOrEmpty(serviceName))
                {
                    trace.Record(Annotations.ServiceName(serviceName));
                }
                if (!String.IsNullOrEmpty(requestType))
                {
                    trace.Record(Annotations.Rpc("GET"));
                }
                break;

            case ZKAnnotations.SS:
                trace.Record(Annotations.ServerSend());
                if (!String.IsNullOrEmpty(serviceName))
                {
                    trace.Record(Annotations.ServiceName(serviceName));
                }
                if (!String.IsNullOrEmpty(requestType))
                {
                    trace.Record(Annotations.Rpc("GET"));
                }
                break;

            case ZKAnnotations.SR:
                trace.Record(Annotations.ServerRecv());
                if (!String.IsNullOrEmpty(serviceName))
                {
                    trace.Record(Annotations.ServiceName(serviceName));
                }
                if (!String.IsNullOrEmpty(requestType))
                {
                    trace.Record(Annotations.Rpc("GET"));
                }
                break;
            }
        }
Exemplo n.º 12
0
        public async Task <IActionResult> Get()
        {
            _trace.Record(Annotations.ClientSend());
            _trace.Record(Annotations.ServiceName("FlickrSearch:PhotoInfo"));
            _trace.Record(Annotations.Rpc("GET"));

            var result = await _flickrSearchService.GetPhotoInfoAsync("7012518889");

            _trace.Record(Annotations.ClientRecv());

            return(Ok(result));
        }
Exemplo n.º 13
0
 public void SimpleAnnotationsCorrectlyAdded()
 {
     AnnotationCorrectlyAdded(Annotations.ClientSend(), zipkinCoreConstants.CLIENT_SEND, false, false);
     AnnotationCorrectlyAdded(Annotations.ClientRecv(), zipkinCoreConstants.CLIENT_RECV, false, true);
     AnnotationCorrectlyAdded(Annotations.ServerRecv(), zipkinCoreConstants.SERVER_RECV, false, false);
     AnnotationCorrectlyAdded(Annotations.ServerSend(), zipkinCoreConstants.SERVER_SEND, false, true);
     AnnotationCorrectlyAdded(Annotations.WireRecv(), zipkinCoreConstants.WIRE_RECV, false, false);
     AnnotationCorrectlyAdded(Annotations.WireSend(), zipkinCoreConstants.WIRE_SEND, false, false);
     AnnotationCorrectlyAdded(Annotations.LocalOperationStart("Operation"), zipkinCoreConstants.LOCAL_COMPONENT, true, false);
     AnnotationCorrectlyAdded(Annotations.ConsumerStart(), zipkinCoreConstants.MESSAGE_RECV, false, false);
     AnnotationCorrectlyAdded(Annotations.ProducerStart(), zipkinCoreConstants.MESSAGE_SEND, false, false);
     AnnotationCorrectlyAdded(Annotations.MessageAddr("service", new IPEndPoint(0, 1)), zipkinCoreConstants.MESSAGE_ADDR, true, false);
 }
Exemplo n.º 14
0
        public void SpanHasDurationOnlyIfValueIsPositive(int offset, bool shouldHaveDuration)
        {
            var duration = GetSpanDuration(offset, Annotations.ClientSend(), Annotations.ClientRecv());

            if (shouldHaveDuration)
            {
                Assert.AreEqual(offset, (int)duration.Value.TotalMilliseconds);
            }
            else
            {
                Assert.False(duration.HasValue);
            }
        }
Exemplo n.º 15
0
        private static Span CreateClientSpan()
        {
            var trace = Trace.Create();

            trace.Record(Annotations.ClientSend());
            trace.Record(Annotations.Rpc("query"));
            trace.Record(Annotations.ServiceName("zipkin-client"));
            trace.Record(Annotations.Tag("jdbc.query", "select distinct `zipkin_spans`.`trace_id` from `zipkin_spans` join `zipkin_annotations` on (`zipkin_spans`.`trace_id` = `zipkin_annotations`.`trace_id` and `zipkin_spans`.`id` = `zipkin_annotations`.`span_id`) where (`zipkin_annotations`.`endpoint_service_name` = ? and `zipkin_spans`.`start_ts` between ? and ?) order by `zipkin_spans`.`start_ts` desc limit ?"));
            trace.Record(Annotations.Tag("ca", "frontend"));
            trace.Record(Annotations.Tag("sa", "backend"));
            trace.Record(Annotations.ClientRecv());
            return(new Span(trace.CurrentSpan, new DateTime()));
        }
Exemplo n.º 16
0
 public void FactoryReturnsCorrectTypes()
 {
     Assert.IsInstanceOf <TagAnnotation>(Annotations.Tag("", ""));
     Assert.IsInstanceOf <ClientRecv>(Annotations.ClientRecv());
     Assert.IsInstanceOf <ClientSend>(Annotations.ClientSend());
     Assert.IsInstanceOf <LocalAddr>(Annotations.LocalAddr(null));
     Assert.IsInstanceOf <Rpc>(Annotations.Rpc(""));
     Assert.IsInstanceOf <ServerRecv>(Annotations.ServerRecv());
     Assert.IsInstanceOf <ServerSend>(Annotations.ServerSend());
     Assert.IsInstanceOf <ServiceName>(Annotations.ServiceName(""));
     Assert.IsInstanceOf <Event>(Annotations.Event(""));
     Assert.IsInstanceOf <ClientAddr>(Annotations.ClientAddr(null));
     Assert.IsInstanceOf <ServerAddr>(Annotations.ServerAddr(null, null));
 }
Exemplo n.º 17
0
        /// <summary>
        /// Конструктор таймера метрик, который трейсит обращения к сервиса к внешним ресурсам
        /// </summary>
        /// <param name="trace"></param>
        /// <param name="tracingServiceName"></param>
        /// <param name="methodName"></param>
        /// <param name="getTracingTagsCallback"></param>
        public TracingTimer(Trace trace, string tracingServiceName, string methodName, Dictionary <string, string> getTracingTagsCallback)
        {
            if ((_trace = trace?.Child()) != null)
            {
                _trace.Record(Annotations.ServiceName(tracingServiceName));
                _trace.Record(Annotations.ClientSend());
                _trace.Record(Annotations.Rpc($"{tracingServiceName}_{methodName}"));

                foreach (var tag in getTracingTagsCallback)
                {
                    _trace.Record(Annotations.Tag(tag.Key, tag.Value));
                }
            }
        }
Exemplo n.º 18
0
        public ITransmissionResponse Send(Stream inputStream)
        {
            var trace = Trace.Create();

            trace.Record(Annotations.ServiceName("TransmissionService"));
            trace.Record(Annotations.ClientSend());
            try
            {
                return(this.Send(inputStream, trace));
            }
            finally
            {
                trace.Record(Annotations.ClientRecv());
            }
        }
Exemplo n.º 19
0
        public ITransmissionRequest Build(Trace root)
        {
            Trace span = root.Child();

            span.Record(Annotations.ServiceName("build"));
            span.Record(Annotations.ClientSend());
            try
            {
                return(this.Build());
            }
            finally
            {
                span.Record(Annotations.ClientRecv());
            }
        }
Exemplo n.º 20
0
        /// <inheritdoc />
        public ITransmissionResponse Transmit(ITransmissionMessage transmissionMessage)
        {
            Trace root = Trace.Create();

            root.Record(Annotations.ServiceName("transmit"));
            root.Record(Annotations.ClientSend());
            try
            {
                return(this.Perform(transmissionMessage, root));
            }
            finally
            {
                root.Record(Annotations.ClientRecv());
            }
        }
Exemplo n.º 21
0
        public ITransmissionMessage NewInstance(Stream inputStream)
        {
            Trace trace = Trace.Create();

            trace.Record(Annotations.ServiceName(this.GetType().Name));
            trace.Record(Annotations.ClientSend());
            try
            {
                return(this.Perform(inputStream, trace));
            }
            finally
            {
                trace.Record(Annotations.ClientRecv());
            }
        }
Exemplo n.º 22
0
        public ITransmissionMessage NewInstance(Stream inputStream, Trace root)
        {
            var trace = root.Child();

            trace.Record(Annotations.ServiceName(this.GetType().Name));
            trace.Record(Annotations.ClientSend());
            try
            {
                return(this.Perform(inputStream, root));
            }
            finally
            {
                trace.Record(Annotations.ClientRecv());
            }
        }
Exemplo n.º 23
0
        /// <inheritdoc />
        public ITransmissionResponse Transmit(ITransmissionMessage transmissionMessage, Trace root)
        {
            Trace span = root.Child();

            span.Record(Annotations.ServiceName("transmit"));
            span.Record(Annotations.ClientSend());
            try
            {
                return(this.Perform(transmissionMessage, span));
            }
            finally
            {
                span.Record(Annotations.ClientRecv());
            }
        }
        private IAnnotation GetOpeningAnnotation(OtSpanKind spanKind)
        {
            switch (spanKind)
            {
            case OtSpanKind.Client:
                return(Annotations.ClientSend());

            case OtSpanKind.Server:
                return(Annotations.ServerRecv());

            case OtSpanKind.Local:
                return(Annotations.LocalOperationStart(_tracer.ServiceName));

            default:
                throw new NotSupportedException("SpanKind: " + spanKind + " unknown.");
            }
        }
Exemplo n.º 25
0
        public void Persist(
            ITransmissionRequest transmissionRequest,
            ITransmissionResponse transmissionResponse,
            Trace root)
        {
            Trace span = root.Child();

            span.Record(Annotations.ServiceName("persist statistics"));
            span.Record(Annotations.ClientSend());
            try
            {
                RawStatisticsBuilder builder = new RawStatisticsBuilder()
                                               .AccessPointIdentifier(this.ourAccessPointIdentifier).Direction(Direction.OUT)
                                               .DocumentType(transmissionResponse.GetHeader().DocumentType)
                                               .Sender(transmissionResponse.GetHeader().Sender)
                                               .Receiver(transmissionResponse.GetHeader().Receiver)
                                               .Profile(transmissionResponse.GetHeader().Process)
                                               .Date(transmissionResponse.GetTimestamp()); // Time stamp of reception of the receipt

                // If we know the CN name of the destination AP, supply that
                // as the channel id otherwise use the protocol name
                if (transmissionRequest.GetEndpoint().Certificate != null)
                {
                    String accessPointIdentifierValue =
                        CertificateUtils.ExtractCommonName(transmissionRequest.GetEndpoint().Certificate);
                    builder.Channel(new ChannelId(accessPointIdentifierValue));
                }
                else
                {
                    String protocolName = transmissionRequest.GetEndpoint().TransportProfile.Identifier;
                    builder.Channel(new ChannelId(protocolName));
                }

                DefaultRawStatistics rawStatistics = builder.Build();
                this.rawStatisticsRepository.Persist(rawStatistics);
            }
            catch (Exception ex)
            {
                span.Record(Annotations.Tag("exception", ex.Message));
                Logger.Error($"Persisting DefaultRawStatistics about oubound transmission failed : {ex.Message}", ex);
            }
            finally
            {
                span.Record(Annotations.ClientRecv());
            }
        }
Exemplo n.º 26
0
        static void Main(string[] args)
        {
            var random = new Random();
            // make sure Zipkin with Scribe client is working
            //var collector = new HttpCollector(new Uri("http://localhost:9411/"));
            var collector = new KafkaCollector(KafkaSettings.Default);
            var traceId   = new TraceHeader(traceId: (ulong)random.Next(), spanId: (ulong)random.Next());
            var span      = new Span(traceId, new IPEndPoint(IPAddress.Loopback, 9000), "test-service");

            span.Record(Annotations.ClientSend(DateTime.UtcNow));
            Thread.Sleep(100);
            span.Record(Annotations.ServerReceive(DateTime.UtcNow));
            Thread.Sleep(100);
            span.Record(Annotations.ServerSend(DateTime.UtcNow));
            Thread.Sleep(100);
            span.Record(Annotations.ClientReceive(DateTime.UtcNow));

            collector.CollectAsync(span).Wait();
        }
Exemplo n.º 27
0
 public void FactoryReturnsCorrectTypes()
 {
     Assert.IsInstanceOf <TagAnnotation>(Annotations.Tag("", ""));
     Assert.IsInstanceOf <ClientRecv>(Annotations.ClientRecv());
     Assert.IsInstanceOf <ClientSend>(Annotations.ClientSend());
     Assert.IsInstanceOf <LocalAddr>(Annotations.LocalAddr(null));
     Assert.IsInstanceOf <Rpc>(Annotations.Rpc(""));
     Assert.IsInstanceOf <ServerRecv>(Annotations.ServerRecv());
     Assert.IsInstanceOf <ServerSend>(Annotations.ServerSend());
     Assert.IsInstanceOf <ServiceName>(Annotations.ServiceName(""));
     Assert.IsInstanceOf <Event>(Annotations.Event(""));
     Assert.IsInstanceOf <ClientAddr>(Annotations.ClientAddr(null));
     Assert.IsInstanceOf <ServerAddr>(Annotations.ServerAddr(null, null));
     Assert.IsInstanceOf <MessageAddr>(Annotations.MessageAddr(null, null));
     Assert.IsInstanceOf <ConsumerStart>(Annotations.ConsumerStart());
     Assert.IsInstanceOf <ConsumerStop>(Annotations.ConsumerStop());
     Assert.IsInstanceOf <ProducerStart>(Annotations.ProducerStart());
     Assert.IsInstanceOf <ProducerStop>(Annotations.ProducerStop());
     Assert.IsInstanceOf <LocalOperationStart>(Annotations.LocalOperationStart(""));
     Assert.IsInstanceOf <LocalOperationStop>(Annotations.LocalOperationStop());
 }
Exemplo n.º 28
0
        public ITransmissionResponse Send(ITransmissionRequest request, Trace traceParent)
        {
            this.transmissionRequest = request;

            this.root = traceParent.Child();
            this.root.Record(Annotations.ServiceName("Send AS2 message"));
            this.root.Record(Annotations.ClientSend());
            try
            {
                return(this.SendHttpRequest(this.PrepareHttpRequest()));
            }
            catch (HyperwayTransmissionException e)
            {
                this.root.Record(Annotations.Tag("exception", e.Message));
                throw;
            }
            finally
            {
                this.root.Record(Annotations.ClientRecv());
            }
        }
        /// <summary>
        /// Invokes a duplex streaming call asynchronously.
        /// In duplex streaming scenario, client sends a stream of requests and server responds with a stream of responses.
        /// The response stream is completely independent and both side can be sending messages at the same time.
        /// </summary>
        public override AsyncDuplexStreamingCall <TRequest, TResponse> AsyncDuplexStreamingCall <TRequest, TResponse>(Method <TRequest, TResponse> method, string host, CallOptions options)
        {
            var trace = this.ResolveTraceSpan().Child();

            trace.Record(Annotations.ClientSend());
            trace.Record(Annotations.ServiceName(_serviceName));
            trace.Record(Annotations.Rpc("grpc"));

            var channel = new Channel(_target, ChannelCredentials.Insecure);
            var call    = CreateCall(channel, method, host, options, trace);

            try
            {
                var response = Calls.AsyncDuplexStreamingCall(call);
                return(response);
            }
            finally
            {
                trace.Record(Annotations.ClientRecv());
                channel.ShutdownAsync();
            }
        }
Exemplo n.º 30
0
        protected ITransmissionResponse PerformTransmission(
            DirectoryInfo evidencePath,
            ITransmitter transmitter,
            ITransmissionRequest transmissionRequest,
            Trace root)
        {
            Trace span = root.Child();

            span.Record(Annotations.ServiceName("transmission"));
            span.Record(Annotations.ClientSend());
            try
            {
                // ... and performs the transmission
                Stopwatch watch = new Stopwatch();
                watch.Start();
                // long start = System.DateTime.Now;
                ITransmissionResponse transmissionResponse = transmitter.Transmit(transmissionRequest, span);
                watch.Stop();

                long durationInMs = watch.ElapsedMilliseconds; // System.DateTime.Now - start;

                Log.Debug(
                    String.Format(
                        "Message using messageId {0} sent to {1} using {2} was assigned transmissionId {3} took {4}ms\n",
                        transmissionResponse.GetHeader().Identifier.Identifier,
                        transmissionResponse.GetEndpoint().Address,
                        transmissionResponse.GetProtocol().Identifier,
                        transmissionResponse.GetTransmissionIdentifier(),
                        durationInMs));

                this.SaveEvidence(transmissionResponse, evidencePath, span);

                return(transmissionResponse);
            }
            finally
            {
                span.Record(Annotations.ClientRecv());
            }
        }