code: func (s *HTTPServer) AgentHealthServiceByName(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
  	// Pull out the service name
  	serviceName := strings.TrimPrefix(req.URL.Path, "/v1/agent/health/service/name/")
  	if serviceName == "" {
  		return nil, &BadRequestError{Reason: "Missing service Name"}
  	}
  	code := http.StatusNotFound
  	status := fmt.Sprintf("ServiceName %s Not Found", serviceName)
  	services := s.agent.State.Services()
  	result := make([]api.AgentServiceChecksInfo, 0, 16)
  	proxies := s.agent.State.Proxies()
  	for _, service := range services {
  		if service.Service == serviceName {
  			scode, sstatus, healthChecks := agentHealthService(service.ID, s)
  			serviceInfo := buildAgentService(service, proxies)
  			res := api.AgentServiceChecksInfo{
  				AggregatedStatus: sstatus,
  				Checks:           healthChecks,
  				Service:          &serviceInfo,
  			}
  			result = append(result, res)
  			// When service is not found, we ignore it and keep existing HTTP status
  			if code == http.StatusNotFound {
  				code = scode
  				status = sstatus
  			}
  			// We take the worst of all statuses, so we keep iterating
  			// passing: 200 < warning: 429 < critical: 503
  			if code < scode {
  				code = scode
  				status = sstatus
  			}
  		}
  	}
  	if returnTextPlain(req) {
  		return status, CodeWithPayloadError{StatusCode: code, Reason: status, ContentType: "text/plain"}
  	}
  	return result, CodeWithPayloadError{StatusCode: code, Reason: status, ContentType: "application/json"}
  }
docs: // AgentHealthServiceByName return the worse status of all the services with given name on an agent