Esempio n. 1
0
func reportRegionError(e *errorpb.Error) {
	if e.GetNotLeader() != nil {
		regionErrorCounter.WithLabelValues("not_leader").Inc()
	} else if e.GetRegionNotFound() != nil {
		regionErrorCounter.WithLabelValues("region_not_found").Inc()
	} else if e.GetKeyNotInRegion() != nil {
		regionErrorCounter.WithLabelValues("key_not_in_region").Inc()
	} else if e.GetStaleEpoch() != nil {
		regionErrorCounter.WithLabelValues("stale_epoch").Inc()
	} else if e.GetServerIsBusy() != nil {
		regionErrorCounter.WithLabelValues("server_is_busy").Inc()
	} else {
		regionErrorCounter.WithLabelValues("unknown").Inc()
	}
}