File tree Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,12 @@ const tpl = `
5757 {{ end }}
5858 </tbody>
5959 </table>
60+ <br>
61+ {{ if .ShowTokens }}
62+ <input type="button" value="Hide Ingester Tokens" onclick="window.location.href = '/ring'" />
63+ {{ else }}
64+ <input type="button" value="Show Ingester Tokens" onclick="window.location.href = '/ring?tokens=true'" />
65+ {{ end }}
6066 <pre>{{ .Ring }}</pre>
6167 </form>
6268 </body>
@@ -129,14 +135,23 @@ func (r *Ring) ServeHTTP(w http.ResponseWriter, req *http.Request) {
129135 })
130136 }
131137
138+ tokensParam := req .URL .Query ().Get ("tokens" )
139+ var ringDescString string
140+ showTokens := false
141+ if tokensParam == "true" {
142+ ringDescString = proto .MarshalTextString (r .ringDesc )
143+ showTokens = true
144+ }
132145 if err := tmpl .Execute (w , struct {
133- Ingesters []interface {}
134- Now time.Time
135- Ring string
146+ Ingesters []interface {}
147+ Now time.Time
148+ Ring string
149+ ShowTokens bool
136150 }{
137- Ingesters : ingesters ,
138- Now : time .Now (),
139- Ring : proto .MarshalTextString (r .ringDesc ),
151+ Ingesters : ingesters ,
152+ Now : time .Now (),
153+ Ring : ringDescString ,
154+ ShowTokens : showTokens ,
140155 }); err != nil {
141156 http .Error (w , err .Error (), http .StatusInternalServerError )
142157 return
You can’t perform that action at this time.
0 commit comments