GuoDuanLZ commented on a change in pull request #4177: Enhance gRPC plugin URL: https://github.com/apache/skywalking/pull/4177#discussion_r371717846
########## File path: test/plugin/scenarios/grpc-scenario/config/expectedData.yaml ########## @@ -15,239 +15,524 @@ # limitations under the License. registryItems: applications: - - {grpc-scenario: 2} + - { grpc-scenario: 2 } instances: - - {grpc-scenario: 1} + - { grpc-scenario: 1 } operationNames: - - grpc-scenario: [Greeter.sayHello, GreeterBlocking.sayHello, - /grpc-scenario/case/grpc-scenario] + - grpc-scenario: [Greeter.sayHello, GreeterBlocking.sayHello, GreeterBlockingError.sayHello, /grpc-scenario/case/grpc-scenario] heartbeat: [] segmentItems: - - applicationCode: grpc-scenario - segmentSize: gt 10 - segments: - - segmentId: not null - spans: - - operationName: GreeterBlocking.sayHello - operationId: 0 - parentSpanId: -1 - spanId: 0 - spanLayer: RPCFramework - startTime: nq 0 - endTime: nq 0 - componentId: 23 - componentName: '' - isError: false - spanType: Entry - peer: '' - peerId: 0 - refs: - - {parentEndpointId: 0, parentEndpoint: /grpc-scenario/case/grpc-scenario, networkAddressId: 0, - entryEndpointId: 0, refType: CrossProcess, parentSpanId: 2, parentTraceSegmentId: not null, - parentServiceInstanceId: 1, networkAddress: '127.0.0.1:18080', entryEndpoint: /grpc-scenario/case/grpc-scenario, - entryServiceInstanceId: 1} - - segmentId: not null - spans: - - operationName: Greeter.sayHello - operationId: 0 - parentSpanId: -1 - spanId: 0 - spanLayer: RPCFramework - startTime: nq 0 - endTime: nq 0 - componentId: 23 - componentName: '' - isError: false - spanType: Entry - peer: '' - peerId: 0 - refs: - - {parentEndpointId: 0, parentEndpoint: /grpc-scenario/case/grpc-scenario, networkAddressId: 0, - entryEndpointId: 0, refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null, - parentServiceInstanceId: 1, networkAddress: '127.0.0.1:18080', entryEndpoint: /grpc-scenario/case/grpc-scenario, - entryServiceInstanceId: 1} - - segmentId: not null - spans: - - operationName: GreeterBlocking.sayHello/server/RequestObserver/onNext - operationId: 0 - parentSpanId: -1 - spanId: 0 - spanLayer: Unknown - startTime: nq 0 - endTime: nq 0 - componentId: 0 - componentName: '' - isError: false - spanType: Local - peer: '' - peerId: 0 - refs: - - {parentEndpointId: 0, parentEndpoint: GreeterBlocking.sayHello, networkAddressId: 0, - entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null, - parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, - entryServiceInstanceId: 1} - - segmentId: not null - spans: - - operationName: Greeter.sayHello/server/RequestObserver/onNext - operationId: 0 - parentSpanId: -1 - spanId: 0 - spanLayer: Unknown - startTime: nq 0 - endTime: nq 0 - componentId: 0 - componentName: '' - isError: false - spanType: Local - peer: '' - peerId: 0 - refs: - - {parentEndpointId: 0, parentEndpoint: Greeter.sayHello, networkAddressId: 0, - entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null, - parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, - entryServiceInstanceId: 1} - - segmentId: not null - spans: - - operationName: Greeter.sayHello/client/ResponseObserver/onNext - operationId: 0 - parentSpanId: -1 - spanId: 0 - spanLayer: Unknown - startTime: nq 0 - endTime: nq 0 - componentId: 0 - componentName: '' - isError: false - spanType: Local - peer: '' - peerId: 0 - refs: - - {parentEndpointId: 0, parentEndpoint: /grpc-scenario/case/grpc-scenario, networkAddressId: 0, - entryEndpointId: 0, refType: CrossThread, parentSpanId: 1, parentTraceSegmentId: not null, - parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, - entryServiceInstanceId: 1} - - segmentId: not null - spans: - - operationName: Greeter.sayHello/client/ResponseObserver/onComplete - operationId: 0 - parentSpanId: -1 - spanId: 0 - spanLayer: Unknown - startTime: nq 0 - endTime: nq 0 - componentId: 0 - componentName: '' - isError: false - spanType: Local - peer: '' - peerId: 0 - refs: - - {parentEndpointId: 0, parentEndpoint: /grpc-scenario/case/grpc-scenario, networkAddressId: 0, - entryEndpointId: 0, refType: CrossThread, parentSpanId: 1, parentTraceSegmentId: not null, - parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, - entryServiceInstanceId: 1} - - segmentId: not null - spans: - - operationName: Greeter.sayHello/server/RequestObserver/onNext - operationId: 0 - parentSpanId: -1 - spanId: 0 - spanLayer: Unknown - startTime: nq 0 - endTime: nq 0 - componentId: 0 - componentName: '' - isError: false - spanType: Local - peer: '' - peerId: 0 - refs: - - {parentEndpointId: 0, parentEndpoint: Greeter.sayHello, networkAddressId: 0, - entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null, - parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, - entryServiceInstanceId: 1} - - segmentId: not null - spans: - - operationName: Greeter.sayHello/server/RequestObserver/onComplete - operationId: 0 - parentSpanId: -1 - spanId: 0 - spanLayer: Unknown - startTime: nq 0 - endTime: nq 0 - componentId: 0 - componentName: '' - isError: false - spanType: Local - peer: '' - peerId: 0 - refs: - - {parentEndpointId: 0, parentEndpoint: Greeter.sayHello, networkAddressId: 0, - entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null, - parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, - entryServiceInstanceId: 1} - - segmentId: not null - spans: - - operationName: Greeter.sayHello - operationId: 0 - parentSpanId: 0 - spanId: 1 - spanLayer: RPCFramework - startTime: nq 0 - endTime: nq 0 - componentId: 23 - componentName: '' - isError: false - spanType: Exit - peer: '127.0.0.1:18080' - peerId: 0 - - operationName: GreeterBlocking.sayHello - operationId: 0 - parentSpanId: 0 - spanId: 2 - spanLayer: RPCFramework - startTime: nq 0 - endTime: nq 0 - componentId: 23 - componentName: '' - isError: false - spanType: Exit - peer: '127.0.0.1:18080' - peerId: 0 - - operationName: /grpc-scenario/case/grpc-scenario - operationId: 0 - parentSpanId: -1 - spanId: 0 - spanLayer: Http - startTime: nq 0 - endTime: nq 0 - componentId: 1 - componentName: '' - isError: false - spanType: Entry - peer: '' - peerId: 0 - tags: - - {key: url, value: 'http://localhost:8080/grpc-scenario/case/grpc-scenario'} - - {key: http.method, value: GET} - - segmentId: not null - spans: - - operationName: Greeter.sayHello/client/ResponseObserver/onNext - operationId: 0 - parentSpanId: -1 - spanId: 0 - spanLayer: Unknown - startTime: nq 0 - endTime: nq 0 - componentId: 0 - componentName: '' - isError: false - spanType: Local - peer: '' - peerId: 0 - refs: - - {parentEndpointId: 0, parentEndpoint: /grpc-scenario/case/grpc-scenario, networkAddressId: 0, - entryEndpointId: 0, refType: CrossThread, parentSpanId: 1, parentTraceSegmentId: not null, - parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, - entryServiceInstanceId: 1} - +- applicationCode: grpc-scenario + segmentSize: gt 10 + segments: + - segmentId: not null + spans: + - operationName: GreeterBlocking.sayHello + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Entry + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: /grpc-scenario/case/grpc-scenario, networkAddressId: 0, + entryEndpointId: 0, refType: CrossProcess, parentSpanId: 2, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '127.0.0.1:18080', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - segmentId: not null + spans: + - operationName: Greeter.sayHello/client/Request/onMessage + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: /grpc-scenario/case/grpc-scenario, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 1, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - segmentId: not null + spans: + - operationName: Greeter.sayHello/client/Request/onMessage + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: /grpc-scenario/case/grpc-scenario, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 1, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - segmentId: not null + spans: + - operationName: Greeter.sayHello/client/Request/onComplete + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: /grpc-scenario/case/grpc-scenario, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 1, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - segmentId: not null + spans: + - operationName: Greeter.sayHello + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Entry + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: /grpc-scenario/case/grpc-scenario, networkAddressId: 0, + entryEndpointId: 0, refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '127.0.0.1:18080', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - segmentId: not null + spans: + - operationName: Greeter.sayHello/server/Response/onMessage + operationId: 0 + parentSpanId: 0 + spanId: 1 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: Greeter.sayHello, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - operationName: Greeter.sayHello/server/Request/onMessage + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: Greeter.sayHello, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - segmentId: not null + spans: + - operationName: Greeter.sayHello/client/Response/onMessage + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: /grpc-scenario/case/grpc-scenario, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 1, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - segmentId: not null + spans: + - operationName: GreeterBlocking.sayHello/server/Response/onClose + operationId: 0 + parentSpanId: 0 + spanId: 1 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + tags: + - { key: status_code, value: OK } + refs: + - {parentEndpointId: 0, parentEndpoint: GreeterBlocking.sayHello, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - operationName: GreeterBlocking.sayHello/server/Request/onComplete + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: GreeterBlocking.sayHello, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - segmentId: not null + spans: + - operationName: Greeter.sayHello/server/Response/onMessage + operationId: 0 + parentSpanId: 0 + spanId: 1 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: Greeter.sayHello, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - operationName: Greeter.sayHello/server/Request/onMessage + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: Greeter.sayHello, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - segmentId: not null + spans: + - operationName: Greeter.sayHello/server/Response/onClose + operationId: 0 + parentSpanId: 0 + spanId: 1 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + tags: + - {key: status_code, value: OK} + refs: + - {parentEndpointId: 0, parentEndpoint: Greeter.sayHello, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - operationName: Greeter.sayHello/server/Request/onComplete + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: Greeter.sayHello, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - segmentId: not null + spans: + - operationName: Greeter.sayHello/client/Response/onMessage + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: /grpc-scenario/case/grpc-scenario, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 1, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - segmentId: not null + spans: + - operationName: Greeter.sayHello/client/Response/onClose + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: /grpc-scenario/case/grpc-scenario, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 1, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - segmentId: not null + spans: + - operationName: GreeterBlockingError.sayHello + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Entry + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: /grpc-scenario/case/grpc-scenario, networkAddressId: 0, + entryEndpointId: 0, refType: CrossProcess, parentSpanId: 5, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '127.0.0.1:18080', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - segmentId: not null + spans: + - operationName: GreeterBlockingError.sayHello/server/Response/onClose + operationId: 0 + parentSpanId: 0 + spanId: 1 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: true + spanType: Local + peer: '' + peerId: 0 + tags: + - { key: status_code, value: UNKNOWN } + logs: + - logEvent: + - { key: event, value: error } + - { key: error.kind, value: java.lang.Exception } + - { key: message, value: '' } + - key: stack + value: not null + refs: + - {parentEndpointId: 0, parentEndpoint: GreeterBlockingError.sayHello, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - operationName: GreeterBlockingError.sayHello/server/Request/onComplete + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Local + peer: '' + peerId: 0 + refs: + - {parentEndpointId: 0, parentEndpoint: GreeterBlockingError.sayHello, networkAddressId: 0, + entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null, + parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /grpc-scenario/case/grpc-scenario, + entryServiceInstanceId: 1} + - segmentId: not null + spans: + - operationName: Greeter.sayHello + operationId: 0 + parentSpanId: 0 + spanId: 1 + spanLayer: RPCFramework + startTime: nq 0 + endTime: nq 0 + componentId: 23 + componentName: '' + isError: false + spanType: Exit + peer: '127.0.0.1:18080' + peerId: 0 + - {operationName: GreeterBlocking.sayHello/client/Request/onComplete, operationId: 0, + parentSpanId: 2, spanId: 3, spanLayer: RPCFramework, startTime: nq 0, + endTime: nq 0, componentId: 23, componentName: '', isError: false, + spanType: Local, peer: '', peerId: 0} + - {operationName: GreeterBlocking.sayHello/client/Response/onClose, operationId: 0, Review comment: > Why do these two use different formats? I know they may be right but it seems strange. When the span is shorter, it is a simplified format. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services