From 85708cc1714f19bfb8a34862f7fd38cbaa6c5f5b Mon Sep 17 00:00:00 2001 From: Kai Hudalla Date: Thu, 2 Apr 2020 08:15:45 +0200 Subject: [PATCH] [#1869] Fix extraction of trace context from CoAP request The TracingSupportingHonoResource used a carrier format that is defined by OpenTracing, but not supported by Jaeger. It now uses the standard BINARY format. Signed-off-by: Kai Hudalla --- .../hono/adapter/coap/CoapOptionInjectExtractAdapter.java | 2 +- .../hono/adapter/coap/TracingSupportingHonoResource.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/adapters/coap-vertx-base/src/main/java/org/eclipse/hono/adapter/coap/CoapOptionInjectExtractAdapter.java b/adapters/coap-vertx-base/src/main/java/org/eclipse/hono/adapter/coap/CoapOptionInjectExtractAdapter.java index bfee8a322b8..724a4b867b3 100644 --- a/adapters/coap-vertx-base/src/main/java/org/eclipse/hono/adapter/coap/CoapOptionInjectExtractAdapter.java +++ b/adapters/coap-vertx-base/src/main/java/org/eclipse/hono/adapter/coap/CoapOptionInjectExtractAdapter.java @@ -23,7 +23,7 @@ import io.opentracing.propagation.Binary; /** - * An adapter for injecting/extracting an OpenTracing span context to/from a CoAP option. + * An adapter for injecting/extracting an OpenTracing {@code SpanContext} to/from a CoAP option. *

* The option number being used to hold the context is {@link #OPTION_TRACE_CONTEXT}. * diff --git a/adapters/coap-vertx-base/src/main/java/org/eclipse/hono/adapter/coap/TracingSupportingHonoResource.java b/adapters/coap-vertx-base/src/main/java/org/eclipse/hono/adapter/coap/TracingSupportingHonoResource.java index 0ae61e00dd9..dd7165cce79 100644 --- a/adapters/coap-vertx-base/src/main/java/org/eclipse/hono/adapter/coap/TracingSupportingHonoResource.java +++ b/adapters/coap-vertx-base/src/main/java/org/eclipse/hono/adapter/coap/TracingSupportingHonoResource.java @@ -78,7 +78,7 @@ public Resource getChild(final String name) { } private SpanContext extractSpanContextFromRequest(final OptionSet requestOptions) { - return tracer.extract(Format.Builtin.BINARY_EXTRACT, new CoapOptionInjectExtractAdapter(requestOptions)); + return tracer.extract(Format.Builtin.BINARY, new CoapOptionInjectExtractAdapter(requestOptions)); } private Span newSpan(final Exchange exchange) {