public void writeB3SingleFormat_sampled() { ITraceContext context = new SpanState(traceId: 1, parentSpanId: null, spanId: 3, isSampled: true, isDebug: false); var b3Format = B3SingleFormat.WriteB3SingleFormat(context); Assert.AreEqual(TraceId + '-' + SpanId + "-1", b3Format); }
public void writeB3SingleFormat_notYetSampled_128() { ITraceContext context = new SpanState(traceIdHigh: 9, traceId: 1, parentSpanId: null, spanId: 3, isSampled: null, isDebug: false); var b3Format = B3SingleFormat.WriteB3SingleFormat(context); Assert.AreEqual("0000000000000009" + TraceId + "-" + SpanId, b3Format); }
/// <summary> /// B3SingleFormat Trace /// </summary> /// <returns></returns> public string GetTrace() { String parent = null; using (var clientTrace = new ClientTrace(_serviceName, null)) { if (clientTrace.Trace != null) { var b3Format = B3SingleFormat.WriteB3SingleFormat(clientTrace.Trace.CurrentSpan); parent = b3Format; } } return(parent); }
public void Inject(ITraceContext traceContext, C carrier) { _setter(carrier, _b3Key, B3SingleFormat.WriteB3SingleFormat(traceContext)); }