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 = `
57
57
{{ end }}
58
58
</tbody>
59
59
</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 }}
60
66
<pre>{{ .Ring }}</pre>
61
67
</form>
62
68
</body>
@@ -129,14 +135,23 @@ func (r *Ring) ServeHTTP(w http.ResponseWriter, req *http.Request) {
129
135
})
130
136
}
131
137
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
+ }
132
145
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
136
150
}{
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 ,
140
155
}); err != nil {
141
156
http .Error (w , err .Error (), http .StatusInternalServerError )
142
157
return
You can’t perform that action at this time.
0 commit comments