async def METHOD_NAME(
    self,
    request: Request,
    call_next: RequestResponseEndpoint,
) -> Response:
    self.init()
    if self._endpoint != request.url.path:  # Filtering endpoint path
        return await call_next(request)
    cached_request = CachedJsonRequest(
        scope=request.scope,
        receive=request.receive,
        send=request._send,
    )
    try:
        # Must obtain input parameters from request
        if cached_request.method in ["POST", "PUT"]:
            content_type = request.headers.get("Content-type", None)
            if content_type is None:
                if "application/json" not in content_type:
                    return await call_next(request)
            inputs = await cached_request.json()
        elif cached_request.method == "GET":
            inputs = cached_request.query_params._dict
        else:
            raise NotImplementedError("Only request methods POST, PUT and GET are implemented.")
        # Must obtain response from request
        response: Response = await call_next(cached_request)
        if not isinstance(response, (JSONResponse, StreamingResponse)) or response.status_code >= 400:
            return response
        new_response, outputs = await self._extract_response_content(response)
        self._monitor.send_records(inputs=inputs, outputs=outputs)
        return new_response
    except Exception as ex:
        _logger.error("Cannot log to argilla", exc_info=ex)
        return await call_next(request)