Package io.grpc.opentelemetry
Class MetadataSetter
- java.lang.Object
-
- io.grpc.opentelemetry.MetadataSetter
-
- All Implemented Interfaces:
io.opentelemetry.context.propagation.TextMapSetter<io.grpc.Metadata>
final class MetadataSetter extends java.lang.Object implements io.opentelemetry.context.propagation.TextMapSetter<io.grpc.Metadata>
ATextMapSetter
that sets value to gRPCMetadata
. Supports both text and binary headers. Supporting binary header is an optimization path for GrpcTraceBinContextPropagator to work around the lack of binary propagator API and thus avoid base64 (de)encoding when passing data between propagator API interfaces.
-
-
Field Summary
Fields Modifier and Type Field Description private static MetadataSetter
INSTANCE
private static java.util.logging.Logger
logger
-
Constructor Summary
Constructors Constructor Description MetadataSetter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MetadataSetter
getInstance()
(package private) void
set(io.grpc.Metadata carrier, java.lang.String key, byte[] value)
void
set(io.grpc.Metadata carrier, java.lang.String key, java.lang.String value)
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
INSTANCE
private static final MetadataSetter INSTANCE
-
-
Method Detail
-
getInstance
public static MetadataSetter getInstance()
-
set
public void set(@Nullable io.grpc.Metadata carrier, java.lang.String key, java.lang.String value)
- Specified by:
set
in interfaceio.opentelemetry.context.propagation.TextMapSetter<io.grpc.Metadata>
-
set
void set(@Nullable io.grpc.Metadata carrier, java.lang.String key, byte[] value)
-
-