func init() { servenv.OnRun(func() { servenv.AddStatusPart("Tablet", tabletTemplate, func() interface{} { return map[string]interface{}{ "Tablet": agent.Tablet(), "BlacklistedTables": agent.BlacklistedTables(), "DisableQueryService": agent.DisableQueryService(), } }) if agent.IsRunningHealthCheck() { servenv.AddStatusFuncs(template.FuncMap{ "github_com_youtube_vitess_health_html_name": healthHTMLName, }) servenv.AddStatusPart("Health", healthTemplate, func() interface{} { return &healthStatus{Records: agent.History.Records()} }) } tabletserver.AddStatusPart() servenv.AddStatusPart("Binlog Player", binlogTemplate, func() interface{} { return agent.BinlogPlayerMap.Status() }) if onStatusRegistered != nil { onStatusRegistered() } }) }
func init() { servenv.OnRun(func() { if *allowedReplicationLag > 0 { health.Register("replication_reporter", mysqlctl.MySQLReplicationLag(agent.Mysqld, *allowedReplicationLag)) } health.Register("query_service_reporter", &queryServiceRunning{}) }) }
func init() { servenv.OnRun(func() { servenv.AddStatusPart("Topology Cache", topoTemplate, func() interface{} { return resilientSrvTopoServer.CacheStatus() }) servenv.AddStatusPart("Stats", statsTemplate, func() interface{} { return nil }) }) }
func init() { servenv.OnRun(func() { http.Handle("/healthz", http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { if err := agent.Healthy(); err != nil { http.Error(rw, fmt.Sprintf("500 internal server error: agent not healthy: %v", err), http.StatusInternalServerError) return } rw.Header().Set("Content-Length", fmt.Sprintf("%v", len(okMessage))) rw.WriteHeader(http.StatusOK) rw.Write(okMessage) })) }) }
func init() { servenv.OnRun(func() { gorpcvtctlserver.StartServer(ts) }) }
func init() { servenv.OnRun(func() { tabletserver.AddStatusPart() }) }
func init() { servenv.OnRun(func() { gorpcmysqlctlserver.StartServer(mysqld) }) }