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.
This commit is contained in:
Yuri Golobokov 2022-02-07 17:21:14 -08:00
parent 2334ca9dfa
commit ae2a2ac7d0
1 changed files with 18 additions and 0 deletions

View File

@ -555,6 +555,24 @@ export class Subchannel {
(error as Error).message
);
});
if (logging.isTracerEnabled(TRACER_NAME)) {
session.on('remoteSettings', (settings: http2.Settings) => {
this.trace(
'new settings received' +
(this.session !== session ? ' on the old connection' : '') +
': ' +
JSON.stringify(settings)
);
});
session.on('localSettings', (settings: http2.Settings) => {
this.trace(
'local settings acknowledged by remote' +
(this.session !== session ? ' on the old connection' : '') +
': ' +
JSON.stringify(settings)
);
});
}
}
private startConnectingInternal() {