Exemplo n.º 1
0
        public static SpanContext FromString(string from)
        {
            if (from == string.Empty)
            {
                throw new Exception("Cannot convert empty string to SpanContext");
            }

            var parts = from.Split(':');

            if (parts.Length != 4)
            {
                throw new Exception("String does not match tracer state format");
            }

            return(new SpanContext(TraceId.FromString(parts[0]), SpanId.FromString(parts[1]), SpanId.FromString(parts[2]), null, (ContextFlags)byte.Parse(parts[3])));
        }