[ISSUE #9264] fix onHalfClose span operation name (#229)

* fix:onHalfClose using span name '/Request/onComplete' but not '/Request/onHalfClose'

* chore: update CHANGES.md

* fix:testcase with operation name '/Request/onComplete'

Co-authored-by: raymond.chen <raymond.chen@yijinin.com>
This commit is contained in:
drgnchan 2022-06-23 16:55:08 +08:00 committed by GitHub
parent dacdddb1b4
commit a1c64a4edc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 8 deletions

View File

@ -5,6 +5,7 @@ Release Notes.
8.12.0
------------------
* Fix `Shenyu plugin`'s NPE in reading read trace ID when IgnoredTracerContext is used in the context.
* Fix `onHalfClose` using span operation name `/Request/onComplete` but not `/Request/onHalfClose`
#### Documentation

View File

@ -40,6 +40,13 @@ public class Constants {
*/
public static final String REQUEST_ON_MESSAGE_OPERATION_NAME = "/Request/onMessage";
/**
* Operation name for request completed all message sending.
* <p>
* However, the call may still be cancelled.
*/
public static final String REQUEST_ON_HALF_CLOSE_OPERATION_NAME = "/Request/onHalfClose";
/**
* Operation name for client has completed request sending, there are no more incoming request.
* <p>

View File

@ -28,7 +28,7 @@ import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.REQUEST_ON_CANCEL_OPERATION_NAME;
import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.REQUEST_ON_COMPLETE_OPERATION_NAME;
import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.REQUEST_ON_HALF_CLOSE_OPERATION_NAME;
import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.REQUEST_ON_MESSAGE_OPERATION_NAME;
import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.SERVER;
import org.apache.skywalking.apm.plugin.grpc.v1.OperationNameFormatUtil;
@ -93,7 +93,7 @@ public class TracingServerCallListener<REQUEST> extends ForwardingServerCallList
@Override
public void onHalfClose() {
final AbstractSpan span = ContextManager.createLocalSpan(operationPrefix + REQUEST_ON_COMPLETE_OPERATION_NAME);
final AbstractSpan span = ContextManager.createLocalSpan(operationPrefix + REQUEST_ON_HALF_CLOSE_OPERATION_NAME);
span.setComponent(ComponentsDefine.GRPC);
span.setLayer(SpanLayer.RPC_FRAMEWORK);
ContextManager.continued(contextSnapshot);

View File

@ -211,7 +211,7 @@ segmentItems:
skipAnalysis: false
tags:
- {key: rpc.status_code, value: OK}
- operationName: Greeter.sayHello/server/Request/onComplete
- operationName: Greeter.sayHello/server/Request/onHalfClose
parentSpanId: -1
spanId: 0
spanLayer: RPCFramework

View File

@ -32,7 +32,7 @@ segmentItems:
skipAnalysis: false
tags:
- {key: rpc.status_code, value: OK}
- operationName: org.apache.skywalking.apm.testcase.grpc.proto.TestServiceDynamic.unary/server/Request/onComplete
- operationName: org.apache.skywalking.apm.testcase.grpc.proto.TestServiceDynamic.unary/server/Request/onHalfClose
parentSpanId: -1
spanId: 0
spanLayer: RPCFramework

View File

@ -162,7 +162,7 @@ segmentItems:
tags:
- {key: rpc.status_code, value: OK}
skipAnalysis: 'false'
- operationName: GreeterBlocking.sayHello/server/Request/onComplete
- operationName: GreeterBlocking.sayHello/server/Request/onHalfClose
parentSpanId: -1
spanId: 0
spanLayer: RPCFramework
@ -220,7 +220,7 @@ segmentItems:
tags:
- {key: rpc.status_code, value: OK}
skipAnalysis: 'false'
- operationName: Greeter.sayHello/server/Request/onComplete
- operationName: Greeter.sayHello/server/Request/onHalfClose
parentSpanId: -1
spanId: 0
spanLayer: RPCFramework
@ -307,7 +307,7 @@ segmentItems:
- {key: message, value: ''}
- {key: stack, value: not null}
skipAnalysis: 'false'
- operationName: GreeterBlockingError.sayHello/server/Request/onComplete
- operationName: GreeterBlockingError.sayHello/server/Request/onHalfClose
parentSpanId: -1
spanId: 0
spanLayer: RPCFramework

View File

@ -126,7 +126,7 @@ segmentItems:
skipAnalysis: false
tags:
- { key: rpc.status_code, value: OK }
- operationName: echo.EchoServiceJSON.echo/server/Request/onComplete
- operationName: echo.EchoServiceJSON.echo/server/Request/onHalfClose
parentSpanId: -1
spanId: 0
spanLayer: RPCFramework