public static ClientSpan Create(string tracerId, string traceId, string parentSpanId, string spanId, string opName, IDictionary <string, string> bags = null) { var clientSpan = new ClientSpan(); if (bags != null) { clientSpan.Bags = bags; } //todo validate clientSpan.TracerId = tracerId; clientSpan.TraceId = traceId; clientSpan.SpanId = spanId; clientSpan.ParentSpanId = parentSpanId; clientSpan.OpName = opName; return(clientSpan); }
public static ClientSpan TryCreate(ClientSpanLocateMode mode, IClientSpanLocate locate, string opName, IDictionary <string, string> bags = null) { var shouldReturnNull = locate.IsBadLocateArgs(mode); if (shouldReturnNull) { return(null); } var clientSpan = new ClientSpan(); clientSpan.With(locate); clientSpan.OpName = opName; if (bags != null) { clientSpan.Bags = bags; } return(clientSpan); }