Merge pull request #2061 from murgatroid99/grpc-js_channel_stacktrace_trace

grpc-js: Add channel construction stacktrace traces
This commit is contained in:
Michael Lumish 2022-03-16 12:46:21 -07:00 committed by GitHub
commit 18286dab47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -39,6 +39,7 @@ can be set.
- `subchannel_refcount` - Traces subchannel refcount changes. Includes per-call logs.
- `subchannel_flowctrl` - Traces HTTP/2 flow control. Includes per-call logs.
- `subchannel_internals` - Traces HTTP/2 session state. Includes per-call logs.
- `channel_stacktrace` - Traces channel construction events with stack traces.
The following tracers are added by the `@grpc/grpc-js-xds` library:
- `cds_balancer` - Traces the CDS load balancing policy

View File

@ -335,6 +335,8 @@ export class ChannelImplementation implements Channel {
new CompressionFilterFactory(this, this.options),
]);
this.trace('Channel constructed with options ' + JSON.stringify(options, undefined, 2));
const error = new Error();
trace(LogVerbosity.DEBUG, 'channel_stacktrace', '(' + this.channelzRef.id + ') ' + 'Channel constructed \n' + error.stack?.substring(error.stack.indexOf('\n')+1));
}
private getChannelzInfo(): ChannelInfo {