Skip to content

Commit ae2a2ac

Browse files
committed
Add HTTP/2 settings frame tracing.
This adds HTTP/2 settings frame information to debug logs. HTTP/2 settings frame contains important information like max_concurrent_streams and initial_window_size useful for debugging concurrency, latency, and throughput issues.
1 parent 2334ca9 commit ae2a2ac

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/grpc-js/src/subchannel.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,24 @@ export class Subchannel {
555555
(error as Error).message
556556
);
557557
});
558+
if (logging.isTracerEnabled(TRACER_NAME)) {
559+
session.on('remoteSettings', (settings: http2.Settings) => {
560+
this.trace(
561+
'new settings received' +
562+
(this.session !== session ? ' on the old connection' : '') +
563+
': ' +
564+
JSON.stringify(settings)
565+
);
566+
});
567+
session.on('localSettings', (settings: http2.Settings) => {
568+
this.trace(
569+
'local settings acknowledged by remote' +
570+
(this.session !== session ? ' on the old connection' : '') +
571+
': ' +
572+
JSON.stringify(settings)
573+
);
574+
});
575+
}
558576
}
559577

560578
private startConnectingInternal() {

0 commit comments

Comments
 (0)