Skip to content

Commit 727b964

Browse files
committed
Revert "Simplify"
This reverts commit 9312257.
1 parent 9393892 commit 727b964

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

instrumentation/thrift-0.13/library/src/main/java/io/opentelemetry/instrumentation/thrift/v0_13/internal/ClientProtocolDecorator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*/
3030
public final class ClientProtocolDecorator extends TProtocolDecorator {
3131

32+
private final TProtocol protocol;
3233
private final String serviceName;
3334
private final Instrumenter<ThriftRequest, ThriftResponse> instrumenter;
3435
private final ContextPropagators propagators;
@@ -53,6 +54,7 @@ private ClientProtocolDecorator(
5354
State state,
5455
boolean endSpanInline) {
5556
super(protocol);
57+
this.protocol = protocol;
5658
this.serviceName = serviceName;
5759
this.instrumenter = instrumenter;
5860
this.propagators = propagators;
@@ -128,7 +130,7 @@ public void writeFieldStop() throws TException {
128130
carrier.put(key, value);
129131
}
130132
});
131-
ContextPropagationUtil.writeHeaders(this, headers);
133+
ContextPropagationUtil.writeHeaders(protocol, headers);
132134
state.contextPropagated = true;
133135
}
134136

instrumentation/thrift-0.13/library/src/main/java/io/opentelemetry/instrumentation/thrift/v0_13/internal/ServerInProtocolDecorator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
*/
2929
public final class ServerInProtocolDecorator extends TProtocolDecorator {
3030

31+
private final TProtocol protocol;
3132
private final Instrumenter<ThriftRequest, ThriftResponse> instrumenter;
3233
private final String serviceName;
3334

@@ -41,6 +42,7 @@ public ServerInProtocolDecorator(
4142
String serviceName,
4243
Instrumenter<ThriftRequest, ThriftResponse> instrumenter) {
4344
super(protocol);
45+
this.protocol = protocol;
4446
this.serviceName = serviceName;
4547
this.instrumenter = instrumenter;
4648
}
@@ -58,7 +60,7 @@ public TField readFieldBegin() throws TException {
5860
// start span when context propagation field is read, if the message doesn't include context
5961
// propagation field, span will be started in readMessageEnd()
6062
if (field.id == ContextPropagationUtil.TRACE_CONTEXT_FIELD_ID && field.type == TType.MAP) {
61-
Map<String, String> headers = ContextPropagationUtil.readHeaders(this);
63+
Map<String, String> headers = ContextPropagationUtil.readHeaders(protocol);
6264
super.readFieldEnd();
6365

6466
Socket socket = SocketAccessor.getSocket(super.getTransport());

0 commit comments

Comments
 (0)