Skip to content

Commit

Permalink
fix: add missing error status handler (open-telemetry#1005)
Browse files Browse the repository at this point in the history
  • Loading branch information
markwolff authored May 1, 2020
1 parent 4c29ae9 commit d246c54
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 d246c54

Please sign in to comment.