Skip to content

Commit

Permalink
feat(instrumentation-grpc): monitor error events with events.errorMon…
Browse files Browse the repository at this point in the history
…itor (#5369)

Co-authored-by: Marc Pichler <[email protected]>
  • Loading branch information
cjihrig and pichlermarc authored Jan 27, 2025
1 parent bdc0e3a commit c43f172
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ All notable changes to experimental packages in this project will be documented

### :bug: (Bug Fix)

* fix(instrumentation-grpc): monitor error events with events.errorMonitor [#5369](https://github.com/open-telemetry/opentelemetry-js/pull/5369) @cjihrig
* fix(exporter-metrics-otlp-http): browser OTLPMetricExporter was not passing config to OTLPMetricExporterBase super class [#5331](https://github.com/open-telemetry/opentelemetry-js/pull/5331) @trentm

### :books: (Refine Doc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* error event should be processed.
*/

import { errorMonitor } from 'node:events';

import type {
ClientReadableStream,
handleBidiStreamingCall,
Expand Down Expand Up @@ -86,7 +88,7 @@ function serverStreamAndBidiHandler<RequestType, ResponseType>(
endSpan();
});

call.on('error', (err: ServiceError) => {
call.on(errorMonitor, (err: ServiceError) => {
if (call[CALL_SPAN_ENDED]) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ export const runTests = (
bidiStream.write(element);
});

assert.strictEqual(bidiStream.listenerCount('error'), 0);
bidiStream.on('error', (err: ServiceError) => {
reject(err);
});
Expand Down

0 comments on commit c43f172

Please sign in to comment.