mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdhttp: move /stats to /debug/vars
This commit is contained in:
parent
a776064a8b
commit
83c953b153
@ -47,7 +47,7 @@ const (
|
||||
deprecatedMachinesPrefix = "/v2/machines"
|
||||
membersPrefix = "/v2/members"
|
||||
statsPrefix = "/v2/stats"
|
||||
statsPath = "/stats"
|
||||
varsPath = "/debug/vars"
|
||||
metricsPath = "/metrics"
|
||||
healthPath = "/health"
|
||||
versionPath = "/version"
|
||||
@ -85,7 +85,7 @@ func NewClientHandler(server *etcdserver.EtcdServer) http.Handler {
|
||||
mux.HandleFunc(statsPrefix+"/store", sh.serveStore)
|
||||
mux.HandleFunc(statsPrefix+"/self", sh.serveSelf)
|
||||
mux.HandleFunc(statsPrefix+"/leader", sh.serveLeader)
|
||||
mux.HandleFunc(statsPath, serveStats)
|
||||
mux.HandleFunc(varsPath, serveVars)
|
||||
mux.Handle(metricsPath, prometheus.Handler())
|
||||
mux.Handle(membersPrefix, mh)
|
||||
mux.Handle(membersPrefix+"/", mh)
|
||||
@ -288,9 +288,8 @@ func (h *statsHandler) serveLeader(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write(stats)
|
||||
}
|
||||
|
||||
func serveStats(w http.ResponseWriter, r *http.Request) {
|
||||
func serveVars(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
// TODO: getting one key or a prefix of keys based on path
|
||||
fmt.Fprintf(w, "{\n")
|
||||
first := true
|
||||
expvar.Do(func(kv expvar.KeyValue) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user