code: func Recorder() goa.Middleware {
  	registerMetrics()
  
  	return func(h goa.Handler) goa.Handler {
  		return func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
  			startTime := time.Now()
  			err := h(ctx, rw, req)
  
  			// record metrics
  			method, entity, code := labelsVal(ctx)
  			recordReqsTotal(method, entity, code)
  			recordReqSize(method, entity, code, req)
  			recordResSize(method, entity, code, goa.ContextResponse(ctx))
  			recordReqDuration(method, entity, code, startTime)
  
  			return err
  		}
  	}
  }
docs: // Recorder record prometheus metrics related to http request and response.