diff --git a/api/src/main/java/io/opentelemetry/correlationcontext/CorrelationContextManager.java b/api/src/main/java/io/opentelemetry/correlationcontext/CorrelationContextManager.java index a6b4a525c91..e9a43195245 100644 --- a/api/src/main/java/io/opentelemetry/correlationcontext/CorrelationContextManager.java +++ b/api/src/main/java/io/opentelemetry/correlationcontext/CorrelationContextManager.java @@ -17,7 +17,6 @@ package io.opentelemetry.correlationcontext; import io.opentelemetry.context.Scope; -import io.opentelemetry.context.propagation.BinaryFormat; import io.opentelemetry.context.propagation.HttpTextFormat; import javax.annotation.concurrent.ThreadSafe; @@ -65,45 +64,6 @@ public interface CorrelationContextManager { */ Scope withContext(CorrelationContext distContext); - /** - * Returns the {@link BinaryFormat} for this implementation. - * - *
Example of usage on the client: - * - *
{@code - * private static final CorrelationContextManager contextManager = - * OpenTelemetry.getCorrelationContextManager(); - * private static final BinaryFormat binaryFormat = contextManager.getBinaryFormat(); - * - * Request createRequest() { - * Request req = new Request(); - * byte[] ctxBuffer = binaryFormat.toByteArray(contextManager.getCurrentContext()); - * request.addMetadata("distributedContext", ctxBuffer); - * return request; - * } - * }- * - *
Example of usage on the server: - * - *
{@code - * private static final CorrelationContextManager contextManager = - * OpenTelemetry.getCorrelationContextManager(); - * private static final BinaryFormat binaryFormat = contextManager.getBinaryFormat(); - * - * void onRequestReceived(Request request) { - * byte[] ctxBuffer = request.getMetadata("distributedContext"); - * CorrelationContext distContext = textFormat.fromByteArray(ctxBuffer); - * try (Scope s = contextManager.withContext(distContext)) { - * // Handle request and send response back. - * } - * } - * }- * - * @return the {@code BinaryFormat} for this implementation. - * @since 0.1.0 - */ - BinaryFormat
If no tracer implementation is provided, this defaults to the W3C Trace Context binary - * format. For more details see W3C Trace - * Context binary protocol. - * - *
Example of usage on the client: - * - *
{@code - * private static final Tracer tracer = OpenTelemetry.getTracer(); - * private static final BinaryFormat binaryFormat = tracer.getBinaryFormat(); - * void onSendRequest() { - * Span span = tracer.spanBuilder("MyRequest").setSpanKind(Span.Kind.CLIENT).startSpan(); - * try (Scope ss = tracer.withSpan(span)) { - * byte[] binaryValue = binaryFormat.toByteArray(tracer.getCurrentContext().context()); - * // Send the request including the binaryValue and wait for the response. - * } finally { - * span.end(); - * } - * } - * }- * - *
Example of usage on the server: - * - *
{@code - * private static final Tracer tracer = OpenTelemetry.getTracer(); - * private static final BinaryFormat binaryFormat = tracer.getBinaryFormat(); - * void onRequestReceived() { - * // Get the binaryValue from the request. - * SpanContext spanContext = SpanContext.INVALID; - * if (binaryValue != null) { - * spanContext = binaryFormat.fromByteArray(binaryValue); - * } - * Span span = tracer.spanBuilder("MyRequest") - * .setParent(spanContext) - * .setSpanKind(Span.Kind.SERVER).startSpan(); - * try (Scope ss = tracer.withSpan(span)) { - * // Handle request and send response back. - * } finally { - * span.end(); - * } - * } - * }- * - * @return the {@code BinaryFormat} for this implementation. - * @since 0.1.0 - */ - BinaryFormat
Format: - * - *
If the value could not be parsed, the underlying implementation will decide to return ether
- * an empty value, an invalid value, or a valid value.
- *
- * @param bytes on-the-wire representation of the value.
- * @return a value deserialized from {@code bytes}.
- * @since 0.1.0
- */
- V fromByteArray(byte[] bytes);
-}
diff --git a/opentracing_shim/src/main/java/io/opentelemetry/opentracingshim/Propagation.java b/opentracing_shim/src/main/java/io/opentelemetry/opentracingshim/Propagation.java
index eeb7ea2d430..2852cc58030 100644
--- a/opentracing_shim/src/main/java/io/opentelemetry/opentracingshim/Propagation.java
+++ b/opentracing_shim/src/main/java/io/opentelemetry/opentracingshim/Propagation.java
@@ -17,10 +17,8 @@
package io.opentelemetry.opentracingshim;
import io.opentelemetry.context.propagation.HttpTextFormat;
-import io.opentracing.propagation.Binary;
import io.opentracing.propagation.TextMapExtract;
import io.opentracing.propagation.TextMapInject;
-import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;
@@ -79,19 +77,4 @@ public String get(Map