/** Returns the hex representation of the span's ID */ public String spanIdString() { String r = spanIdString; if (r == null) { r = spanIdString = toLowerHex(spanId); } return r; }
/** Returns the hex representation of the span's parent ID */ @Nullable public String parentIdString() { String r = parentIdString; if (r == null && parentId != 0L) { r = parentIdString = toLowerHex(parentId); } return r; }
/** Returns the hex representation of the span's local root ID */ @Nullable public String localRootIdString() { String r = localRootIdString; if (r == null && localRootId != 0L) { r = localRootIdString = toLowerHex(localRootId); } return r; }
/** Returns the hex representation of the span's trace ID */ public String traceIdString() { String r = traceIdString; if (r == null) { if (traceIdHigh != 0) { char[] result = new char[32]; writeHexLong(result, 0, traceIdHigh); writeHexLong(result, 16, traceId); r = new String(result); } else { r = toLowerHex(traceId); } traceIdString = r; } return r; }
MDC.put(LEGACY_TRACE_ID_NAME, traceIdString); String parentId = currentSpan.parentId() != null ? HexCodec.toLowerHex(currentSpan.parentId()) : null; replace("parentId", parentId); replace(LEGACY_PARENT_ID_NAME, parentId); String spanId = HexCodec.toLowerHex(currentSpan.spanId()); MDC.put("spanId", spanId); MDC.put(LEGACY_SPAN_ID_NAME, spanId);
MDC.put(LEGACY_TRACE_ID_NAME, traceIdString); String parentId = currentSpan.parentId() != null ? HexCodec.toLowerHex(currentSpan.parentId()) : null; replace("parentId", parentId); replace(LEGACY_PARENT_ID_NAME, parentId); String spanId = HexCodec.toLowerHex(currentSpan.spanId()); MDC.put("spanId", spanId); MDC.put(LEGACY_SPAN_ID_NAME, spanId);
/** Returns the hex representation of the span's ID */ public String spanIdString() { String r = spanIdString; if (r == null) { r = spanIdString = toLowerHex(spanId); } return r; }
/** Returns the hex representation of the span's parent ID */ @Nullable public String parentIdString() { String r = parentIdString; if (r == null && parentId != 0L) { r = parentIdString = toLowerHex(parentId); } return r; }
/** Returns the hex representation of the span's local root ID */ @Nullable public String localRootIdString() { String r = localRootIdString; if (r == null && localRootId != 0L) { r = localRootIdString = toLowerHex(localRootId); } return r; }
/** Returns the hex representation of the span's trace ID */ public String traceIdString() { String r = traceIdString; if (r == null) { if (traceIdHigh != 0) { char[] result = new char[32]; writeHexLong(result, 0, traceIdHigh); writeHexLong(result, 16, traceId); r = new String(result); } else { r = toLowerHex(traceId); } traceIdString = r; } return r; }
public void propagationTraceInfo(HttpUriRequest request, Span span) { TraceContext currentSpan = span.context(); request.addHeader("X-B3-TraceId",currentSpan.traceIdString()); request.addHeader("X-B3-SpanId", HexCodec.toLowerHex(currentSpan.spanId())); if(currentSpan.parentId() != null) { request.addHeader("X-B3-ParentSpanId", HexCodec.toLowerHex(currentSpan.parentId())); } request.addHeader("X-B3-Sampled",String.valueOf(currentSpan.sampled())); }
MDC.put(LEGACY_TRACE_ID_NAME, traceIdString); String parentId = currentSpan.parentId() != null ? HexCodec.toLowerHex(currentSpan.parentId()) : null; replace("parentId", parentId); replace(LEGACY_PARENT_ID_NAME, parentId); String spanId = HexCodec.toLowerHex(currentSpan.spanId()); MDC.put("spanId", spanId); MDC.put(LEGACY_SPAN_ID_NAME, spanId);
MDC.put(LEGACY_TRACE_ID_NAME, traceIdString); String parentId = currentSpan.parentId() != null ? HexCodec.toLowerHex(currentSpan.parentId()) : null; replace("parentId", parentId); replace(LEGACY_PARENT_ID_NAME, parentId); String spanId = HexCodec.toLowerHex(currentSpan.spanId()); MDC.put("spanId", spanId); MDC.put(LEGACY_SPAN_ID_NAME, spanId);