feat: implement etcd gRPC gateway for HTTP JSON-RPC compatibility#38
Merged
axfor merged 1 commit intoaxfor:mainfrom Jan 12, 2026
Merged
feat: implement etcd gRPC gateway for HTTP JSON-RPC compatibility#38axfor merged 1 commit intoaxfor:mainfrom
axfor merged 1 commit intoaxfor:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements an etcd gRPC gateway that enables HTTP/JSON access to etcd v3 API endpoints via grpc-gateway, providing compatibility for clients that prefer HTTP/JSON over native gRPC.
Key changes:
- Added optional etcd grpc-gateway configuration that proxies HTTP requests under
/v3/**to the etcd gRPC service - Integrated gateway handler into the HTTP server with path-based routing
- Modified cmux matchers to support both gRPC and HTTP/JSON traffic on the same port
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/config/config.go | Added EtcdGatewayConfig struct with enable flag and endpoint, plus environment variable overrides and validation |
| configs/config.yaml | Added example etcd_gateway configuration section with enable flag and endpoint |
| cmd/metastore/main.go | Integrated gateway handler creation and setup (appears in both memory and rocksdb storage branches) |
| api/http/server.go | Added gateway handler field and routing logic to intercept /v3/ prefixed requests |
| api/etcdgateway/gateway.go | Core gateway implementation that registers etcd v3 service handlers and normalizes endpoints |
| api/etcdgateway/logging.go | HTTP middleware for logging gateway requests |
| Makefile | Minor whitespace cleanup |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
test:
1、member list
{ "header": { "cluster_id": "1", "member_id": "1", "revision": "3", "raft_term": "5" }, "members": [ { "ID": "1", "name": "node-1", "peerURLs": [ "http://127.0.0.1:9021" ], "clientURLs": [ "http://127.0.0.1:9121" ] } "http://127.0.0.1:9021" ], "clientURLs": [ "http://127.0.0.1:9121" ] } ] } ] }2、put key
{ "header": { "cluster_id": "1", "member_id": "1", "revision": "3", "raft_term": "5" }, "kvs": [ { "key": "Zm9v", "create_revision": "3", "mod_revision": "3", "version": "1", "value": "YmFy" } ], "count": "1" }.... and all other api