async def METHOD_NAME(request, response):
    """
    The on_prepare signal is used to close the request span that is created during
    the trace middleware execution.
    """
    # safe-guard: discard if we don't have a request span
    request_span = request.get(REQUEST_SPAN_KEY, None)
    if not request_span:
        return
    # default resource name
    resource = stringify(response.status)
    if request.match_info.route.resource:
        # collect the resource name based on http resource type
        res_info = request.match_info.route.resource.get_info()
        if res_info.get("path"):
            resource = res_info.get("path")
        elif res_info.get("formatter"):
            resource = res_info.get("formatter")
        elif res_info.get("prefix"):
            resource = res_info.get("prefix")
        # prefix the resource name by the http method
        resource = "{} {}".format(request.method, resource)
    request_span.resource = resource
    # DEV: aiohttp is special case maintains separate configuration from config api
    trace_query_string = request[REQUEST_CONFIG_KEY].get("trace_query_string")
    if trace_query_string is None:
        trace_query_string = config.http.trace_query_string
    if trace_query_string:
        request_span.set_tag_str(http.QUERY_STRING, request.query_string)
    trace_utils.set_http_meta(
        request_span,
        config.aiohttp,
        method=request.method,
        url=str(request.url),  # DEV: request.url is a yarl's URL object
        status_code=response.status,
        request_headers=request.headers,
        response_headers=response.headers,
    )
    request_span.finish()