Skip to content

Commit

Permalink
channelz: recommend using admin.Register instead (#4797)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley committed Sep 23, 2021
1 parent 78d3aa8 commit 6ff68b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// administration services to a gRPC server. The services registered are:
//
// - Channelz: https://github.com/grpc/proposal/blob/master/A14-channelz.md
//
// - CSDS: https://github.com/grpc/proposal/blob/master/A40-csds-support.md
//
// Experimental
Expand Down
4 changes: 4 additions & 0 deletions channelz/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ func init() {
var logger = grpclog.Component("channelz")

// RegisterChannelzServiceToServer registers the channelz service to the given server.
//
// Note: it is preferred to use the admin API
// (https://pkg.go.dev/google.golang.org/grpc/admin#Register) instead to
// register Channelz and other administrative services.
func RegisterChannelzServiceToServer(s grpc.ServiceRegistrar) {
channelzgrpc.RegisterChannelzServer(s, newCZServer())
}
Expand Down

0 comments on commit 6ff68b4

Please sign in to comment.