Skip to content

Commit

Permalink
Add HTTP/2 settings frame tracing.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nimf committed Feb 9, 2022
1 parent 2334ca9 commit ae2a2ac
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/grpc-js/src/subchannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit ae2a2ac

Please sign in to comment.