{"id":13740786,"url":"https://github.com/rantav/go-grpc-channelz","last_synced_at":"2025-07-06T20:07:56.915Z","repository":{"id":39989485,"uuid":"205124681","full_name":"rantav/go-grpc-channelz","owner":"rantav","description":"A ChannelZ UI for gRPC in Golang","archived":false,"fork":false,"pushed_at":"2023-12-02T17:17:34.000Z","size":1271,"stargazers_count":43,"open_issues_count":5,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T12:51:42.607Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rantav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-08-29T09:08:55.000Z","updated_at":"2024-11-05T07:22:48.000Z","dependencies_parsed_at":"2023-12-02T18:22:18.675Z","dependency_job_id":"b7e0c286-c396-41eb-8f6e-2fa014c80ffb","html_url":"https://github.com/rantav/go-grpc-channelz","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/rantav/go-grpc-channelz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rantav%2Fgo-grpc-channelz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rantav%2Fgo-grpc-channelz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rantav%2Fgo-grpc-channelz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rantav%2Fgo-grpc-channelz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rantav","download_url":"https://codeload.github.com/rantav/go-grpc-channelz/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rantav%2Fgo-grpc-channelz/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263966169,"owners_count":23536814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T04:00:52.210Z","updated_at":"2025-07-06T20:07:56.899Z","avatar_url":"https://github.com/rantav.png","language":"Go","funding_links":[],"categories":["Language-Specific"],"sub_categories":["Go"],"readme":"# go-grpc-channelz\n\nAn in-process Channelz UI for gRPC in Golang\n\n## What is Channelz?\n\nChannelz is a gRPC spec for introspection into gRPC channels.\nChannels in gRPC represent connections and sockets. Channelz provides introspection into the current active grpc connections, including incoming and outgoing connections.\nThe full spec can be found [here](https://github.com/grpc/proposal/blob/master/A14-channelz.md)\n\n## What is `go-grpc-channelz`?\n\n`go-grpc-channelz` provides a web UI to view the current start of all gRPC channels. For each channel you'd be able to look into the remote peer, sub-channels, load balancing stategies, number of calls, socket activity and events and so on.\n\nYou install go-grpc-channelz into your service and expose it's web page and that's it. All in all, about 2-5 lines of code.\n\n## Screenshots\n\n![Top Channels](doc/top-channels.png)\n\n![Channel](doc/channel.png)\n\n![Subchannel](doc/subchannel.png)\n\n![Socket](doc/socket.png)\n\n![Server](doc/server.png)\n\n## Usage\n\nChannelz is implemented as a gRPC service. This service is turned off by by default, so you have to turn it on as so:\n\n```go\nimport (\n\tchannelzservice \"google.golang.org/grpc/channelz/service\"\n)\n\n// Register the channelz gRPC service to grpcServer so that we can query it for this service.\nchannelzservice.RegisterChannelzServiceToServer(grpcServer)\n```\n\nIn this example `grpcServer` is a grpc server that you create externally. In many cases this server already exists (you only need one) but if not then here's how to create it:\n\n```go\nimport \"google.golang.org/grpc\"\n\ngrpcServer := grpc.NewServer()\n```\n\nNow you should register the channelz web handler:\n\n```go\nimport channelz \"github.com/rantav/go-grpc-channelz\"\n\n// Register the channelz handler and mount it to /foo.\n// Resources will be available at /foo/channelz\nhttp.Handle(\"/\", channelz.CreateHandler(\"/foo\", grpcBindAddress))\n```\n\nWhere `grpcBindAddress` is the address to which `grpcServer` is bound. This could be for example `\":8080\"` or `\"localhost:8080\"` etc. This address is required because the channelz web service accesses the channelz grpc service in order to query it.\n\nLastly, launch that web listener in order to serve the web UI:\n\n```go\n// Listen and serve HTTP for the default serve mux\nadminListener, err := net.Listen(\"tcp\", \":8081\")\nif err != nil {\n    log.Fatal(err)\n}\ngo http.Serve(adminListener, nil)\n```\n\nNow the service will be available at `http://localhost:8081/foo/channelz`\n\nA complete example:\n\n```go\nimport (\n    \"google.golang.org/grpc\"\n    channelzservice \"google.golang.org/grpc/channelz/service\"\n    channelz \"github.com/rantav/go-grpc-channelz\"\n)\n\ngrpcServer := grpc.NewServer()\n\n// Register the channelz handler\nhttp.Handle(\"/\", channelz.CreateHandler(\"/foo\", grpcBindAddress))\n\n// Register the channelz gRPC service to grpcServer so that we can query it for this service.\nchannelzservice.RegisterChannelzServiceToServer(grpcServer)\n\n// Listen and serve HTTP for the default serve mux\nadminListener, err := net.Listen(\"tcp\", \":8081\")\nif err != nil {\n    log.Fatal(err)\n}\ngo http.Serve(adminListener, nil)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frantav%2Fgo-grpc-channelz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frantav%2Fgo-grpc-channelz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frantav%2Fgo-grpc-channelz/lists"}