File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -316,6 +316,8 @@ func setupIngester(
316
316
log .Fatal (err )
317
317
}
318
318
prometheus .MustRegister (ingester )
319
+
320
+ router .Path ("/ready" ).Handler (http .HandlerFunc (ingester .ReadinessHandler ))
319
321
return ingester
320
322
}
321
323
Original file line number Diff line number Diff line change
1
+ package ingester
2
+
3
+ import (
4
+ "net/http"
5
+ )
6
+
7
+ // ReadinessHandler returns 204 when the ingester is ready,
8
+ // 500 otherwise. It's used by kubernetes to indicate if the ingester
9
+ // pool is ready to have ingesters added / removed.
10
+ func (i * Ingester ) ReadinessHandler (w http.ResponseWriter , r * http.Request ) {
11
+ if i .Ready () {
12
+ w .WriteHeader (http .StatusNoContent )
13
+ } else {
14
+ w .WriteHeader (http .StatusInternalServerError )
15
+ }
16
+ }
You can’t perform that action at this time.
0 commit comments