@Test public void testInvalidParentId() { TextMapAdapter textMap = new TextMapAdapter(new HashMap<>()); textMap.put(TRACE_PARENT, "00-00000000000000000000000000000001-0000000000000000-00"); JaegerSpanContext spanContext = traceContextCodec.extract(textMap); assertNull(spanContext); verifyWarningPresent(); }
@Override public JaegerSpanContext extract(TextMap carrier) { String traceParent = null; String traceState = null; String debugId = null; for (Map.Entry<String, String> entry: carrier) { if (TRACE_PARENT.equalsIgnoreCase(entry.getKey())) { traceParent = entry.getValue(); } if (TRACE_STATE.equalsIgnoreCase(entry.getKey())) { traceState = entry.getValue(); } if (Constants.DEBUG_ID_HEADER_KEY.equalsIgnoreCase(entry.getKey())) { debugId = entry.getValue(); } } if (traceParent == null) { if (debugId != null) { return objectFactory.createSpanContext(0L, 0L, 0L, 0L, (byte) 0, null, debugId); } return null; } return extractContextFromTraceParent(traceParent, traceState, debugId); }
TraceContextCodec implements Codec<TextMap> { @Override public JaegerSpanContext extract(TextMap carrier) { String traceParent = null; String traceState = null; String debugId = null; for (Map.Entry<String, String> entry: carrier) { if (TRACE_PARENT.equalsIgnoreCase(entry.getKey())) { traceParent = entry.getValue(); } if (TRACE_STATE.equalsIgnoreCase(entry.getKey())) { traceState = entry.getValue(); } if (Constants.DEBUG_ID_HEADER_KEY.equalsIgnoreCase(entry.getKey())) { debugId = entry.getValue(); } } if (traceParent == null) { if (debugId != null) { return objectFactory.createSpanContext(0L, 0L, 0L, 0L, (byte) 0, null, debugId); } return null; } return extractContextFromTraceParent(traceParent, traceState, debugId); } }
TraceContextCodec implements Codec<TextMap> { @Override public JaegerSpanContext extract(TextMap carrier) { String traceParent = null; String traceState = null; String debugId = null; for (Map.Entry<String, String> entry: carrier) { if (TRACE_PARENT.equalsIgnoreCase(entry.getKey())) { traceParent = entry.getValue(); } if (TRACE_STATE.equalsIgnoreCase(entry.getKey())) { traceState = entry.getValue(); } if (Constants.DEBUG_ID_HEADER_KEY.equalsIgnoreCase(entry.getKey())) { debugId = entry.getValue(); } } if (traceParent == null) { if (debugId != null) { return objectFactory.createSpanContext(0L, 0L, 0L, 0L, (byte) 0, null, debugId); } return null; } return extractContextFromTraceParent(traceParent, traceState, debugId); } private  TraceContextCodec(Builder builder); }
TraceContextCodec implements Codec<TextMap> { @Override public JaegerSpanContext extract(TextMap carrier) { String traceParent = null; String traceState = null; String debugId = null; for (Map.Entry<String, String> entry: carrier) { if (TRACE_PARENT.equalsIgnoreCase(entry.getKey())) { traceParent = entry.getValue(); } if (TRACE_STATE.equalsIgnoreCase(entry.getKey())) { traceState = entry.getValue(); } if (Constants.DEBUG_ID_HEADER_KEY.equalsIgnoreCase(entry.getKey())) { debugId = entry.getValue(); } } if (traceParent == null) { if (debugId != null) { return objectFactory.createSpanContext(0L, 0L, 0L, 0L, (byte) 0, null, debugId); } return null; } return extractContextFromTraceParent(traceParent, traceState, debugId); } private  TraceContextCodec(Builder builder); @Override JaegerSpanContext extract(TextMap carrier); @Override void inject(JaegerSpanContext spanContext, TextMap carrier); }
TraceContextCodec implements Codec<TextMap> { @Override public JaegerSpanContext extract(TextMap carrier) { String traceParent = null; String traceState = null; String debugId = null; for (Map.Entry<String, String> entry: carrier) { if (TRACE_PARENT.equalsIgnoreCase(entry.getKey())) { traceParent = entry.getValue(); } if (TRACE_STATE.equalsIgnoreCase(entry.getKey())) { traceState = entry.getValue(); } if (Constants.DEBUG_ID_HEADER_KEY.equalsIgnoreCase(entry.getKey())) { debugId = entry.getValue(); } } if (traceParent == null) { if (debugId != null) { return objectFactory.createSpanContext(0L, 0L, 0L, 0L, (byte) 0, null, debugId); } return null; } return extractContextFromTraceParent(traceParent, traceState, debugId); } private  TraceContextCodec(Builder builder); @Override JaegerSpanContext extract(TextMap carrier); @Override void inject(JaegerSpanContext spanContext, TextMap carrier);  }