Skip to content

Commit

Permalink
fix: add missing error status handler
Browse files Browse the repository at this point in the history
  • Loading branch information
markwolff committed Apr 30, 2020
1 parent 23677a1 commit 57ed50f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/opentelemetry-plugin-grpc/src/grpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ export class GrpcPlugin extends BasePlugin<grpc> {
});

call.on('error', (err: grpcTypes.ServiceError) => {
span.setStatus({
code: _grpcStatusCodeToCanonicalCode(err.code),
message: err.message,
});
span.addEvent('finished with error');
span.setAttributes({
[AttributeNames.GRPC_ERROR_NAME]: err.name,
Expand Down

0 comments on commit 57ed50f

Please sign in to comment.