diff --git a/pkg/ring/http.go b/pkg/ring/http.go index 465f908f54..36587c2572 100644 --- a/pkg/ring/http.go +++ b/pkg/ring/http.go @@ -57,6 +57,12 @@ const tpl = ` {{ end }} +
+ {{ if .ShowTokens }} + + {{ else }} + + {{ end }}
{{ .Ring }}
@@ -129,14 +135,23 @@ func (r *Ring) ServeHTTP(w http.ResponseWriter, req *http.Request) { }) } + tokensParam := req.URL.Query().Get("tokens") + var ringDescString string + showTokens := false + if tokensParam == "true" { + ringDescString = proto.MarshalTextString(r.ringDesc) + showTokens = true + } if err := tmpl.Execute(w, struct { - Ingesters []interface{} - Now time.Time - Ring string + Ingesters []interface{} + Now time.Time + Ring string + ShowTokens bool }{ - Ingesters: ingesters, - Now: time.Now(), - Ring: proto.MarshalTextString(r.ringDesc), + Ingesters: ingesters, + Now: time.Now(), + Ring: ringDescString, + ShowTokens: showTokens, }); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return