@@ -748,14 +748,15 @@ describe('LoggerHelper', () => {
748748 'rpc.system.name' : 'grpc' ,
749749 'rpc.method' : 'google.storage.v2.Storage/GetObject' ,
750750 'url.domain' : 'storage.googleapis.com' ,
751+ 'server.address' : 'storage.googleapis.com' ,
751752 'rpc.response.status_code' : 'UNAVAILABLE' ,
752753 'error.type' : 'UNAVAILABLE' ,
754+ 'exception.type' : 'GoogleError' ,
755+ 'exception.message' : 'Unavailable' ,
756+ 'exception.stacktrace' : errWithMeta . stack ,
753757 'response.payload' :
754758 '{"x-goog-request-id":"req-123","trace-bin":"YWJj"}' ,
755759 } ) ;
756- assert . strictEqual ( 'exception.type' in other , false ) ;
757- assert . strictEqual ( 'exception.message' in other , false ) ;
758- assert . strictEqual ( 'exception.stacktrace' in other , false ) ;
759760
760761 sink . reset ( ) ;
761762 const preConnectGrpcErr = Object . assign (
@@ -803,9 +804,13 @@ describe('LoggerHelper', () => {
803804 ] ) ;
804805 const otherWithoutMeta = sink . logs [ 0 ] . fields . other as LogPayload ;
805806 assert . strictEqual ( 'response.payload' in otherWithoutMeta , false ) ;
806- assert . strictEqual ( 'exception.type' in otherWithoutMeta , false ) ;
807- assert . strictEqual ( 'exception.message' in otherWithoutMeta , false ) ;
808- assert . strictEqual ( 'exception.stacktrace' in otherWithoutMeta , false ) ;
807+ assert . strictEqual ( 'server.address' in otherWithoutMeta , false ) ;
808+ assert . strictEqual ( otherWithoutMeta [ 'exception.type' ] , 'TypeError' ) ;
809+ assert . strictEqual ( otherWithoutMeta [ 'exception.message' ] , 'client error' ) ;
810+ assert . strictEqual (
811+ otherWithoutMeta [ 'exception.stacktrace' ] ,
812+ errWithoutMeta . stack ,
813+ ) ;
809814 } ) ;
810815
811816 it ( 'emits response.payload on HTTP REST error responses and omits it on empty or transport failures' , async ( ) => {
0 commit comments