Save bootstrap trace events in a circular buffer (#16823)

This commit is contained in:
Krishnan Parthasarathi
2023-03-17 16:01:03 -07:00
committed by GitHub
parent 280442e533
commit 31fba6f434
5 changed files with 189 additions and 0 deletions

View File

@@ -977,6 +977,12 @@ func (s *peerRESTServer) TraceHandler(w http.ResponseWriter, r *http.Request) {
s.writeErrorResponse(w, err)
return
}
// Publish bootstrap events that have already occurred before client could subscribe.
if traceOpts.TraceTypes().Contains(madmin.TraceBootstrap) {
go globalBootstrapTracer.Publish(r.Context(), globalTrace)
}
keepAliveTicker := time.NewTicker(500 * time.Millisecond)
defer keepAliveTicker.Stop()