예제 #1
0
        internal static LambdaSpan CreateSpan(string operationName, DateTimeOffset timestamp, IDictionary <string, object> tags, LambdaSpan parentSpan, string guid)
        {
            var span = new LambdaSpan(operationName, timestamp, tags, parentSpan, guid);
            LambdaSpanContext context = new LambdaSpanContext(span);

            span.SetContext(context);
            return(span);
        }
예제 #2
0
        public void BuildChildSpanWith_Start()
        {
            var            tracer          = LambdaTracer.Instance;
            var            rootName        = "rootOperationName";
            var            rootSpanBuilder = tracer.BuildSpan(rootName);
            LambdaRootSpan rootSpan        = (LambdaRootSpan)rootSpanBuilder.Start();

            var        childName        = "childOperationName";
            var        childSpanBuilder = tracer.BuildSpan(childName).AsChildOf(rootSpan);
            LambdaSpan childSpan        = (LambdaSpan)childSpanBuilder.Start();

            Assert.AreEqual(rootSpan.Guid(), childSpan.RootSpan.Guid(), "The guid of the child span's RootSpan should match the guid of the root span");
        }
예제 #3
0
 public void Setup()
 {
     _span = new LambdaRootSpan("testOperation", new DateTimeOffset(), new Dictionary <string, object>(), "guid", new DataCollector(_logger, false), new TransactionState(), new PrioritySamplingState(), new DistributedTracingState());
 }