예제 #1
0
        public TextMapPropagationRegistryTests()
        {
            _propagationRegistry = Propagators.TextMap;
            _baggage             = new Dictionary <string, string> {
                { "key1", "value1/val" }, { "key2", "value2/val" }
            };
            _spanContext = Substitute.For <IJaegerCoreSpanContext>();
            _format      = Substitute.For <IFormat <ITextMap> >();

            _spanContext.GetBaggageItems().Returns(_baggage);
        }
예제 #2
0
        public Span(IJaegerCoreTracer tracer, string operationName, IJaegerCoreSpanContext context, DateTime?startTimestampUtc = null, Dictionary <string, object> tags = null, List <Reference> references = null)
        {
            Tracer = tracer ?? throw new ArgumentNullException(nameof(tracer));

            if (string.IsNullOrEmpty(operationName))
            {
                var nullOrEmpty = operationName == null ? "null" : "empty";
                throw new ArgumentException($"Argument is {nullOrEmpty}", nameof(operationName));
            }

            OperationName     = operationName;
            Context           = context ?? throw new ArgumentNullException(nameof(context));
            StartTimestampUtc = startTimestampUtc ?? Tracer.Clock.UtcNow();
            Tags       = tags ?? new Dictionary <string, object>();
            References = references ?? Enumerable.Empty <Reference>();
        }