Add channelz support and the admin interface #1915
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add channelz functionality to grpc-js (see gRFC A14), along with the admin interface (see gRFC A38).
There are three main parts of this change:
channelz.ts
,channel.ts
,subchannel.ts
, andserver.ts
, with small parts incall-stream.ts
andserver-call.ts
to count messages.channelz.ts
.addAdminServicesToServer
function. The registration function takes getters instead of plain objects to support retrieving those things lazily, which allows us to load the channelz service lazily so that we do not need to loadprotobufjs
in applications that do not use channelz.This change adds the following public APIs:
getChannelzServiceDefinition(): ServiceDefinition
getChannelzHandlers(): ServiceHandler
addAdminServicesToServer(server: Server): void
Channel#getChannelzRef(): ChannelRef
Server#getChannelzRef(): ServerRef
The intended use is for a user to do one of the following to serve the channelz service:
OR
In addition, I modified the channel, subchannel, and server trace logs to include the channelz ID to make them easier to cross-reference.
The new
channelz_manual_test.js
file just starts a server and a client that continuously makes requests to that server, and starts another server serving the channelz service, for a separate channelz client to examine.