Ejemplo n.º 1
0
 public async Task <ClientSpan> StartSpan(StartSpanArgs args)
 {
     using (await _asyncLock.LockAsync())
     {
         var clientSpan = ClientSpan.Create(args.TraceId, args.ParentSpanId, Guid.NewGuid().ToString());
         ClientSpans.Add(clientSpan.SpanId, clientSpan);
         return(await Task.FromResult(clientSpan));
     }
 }
Ejemplo n.º 2
0
        public async Task StartSpan(StartSpanArgs args)
        {
            var clientTracer = _factory.GetTracer(args.TraceId);

            if (clientTracer != null)
            {
                var clientSpan = await clientTracer.StartSpan(args);

                if (clientSpan != null)
                {
                    await TraceCallbackResult.MethodResult(nameof(StartSpan), true, args).AutoSet(clientSpan)
                    .SafeInvoke(StartSpanCallback);

                    return;
                }
            }

            await TraceCallbackResult.MethodResult(nameof(StartSpan), false, args).SafeInvoke(StartSpanCallback);
        }