function monitoringHandler(clientIP, req, res, log) {
    function monitoringEndHandler(err, results) {
        writeResponse(res, err, results, error => {
            if (error) {
                return log.end().warn('monitoring error', { err: error });
            }
            return log.end();
        });
    }
    if (req.method !== 'GET') {
        return monitoringEndHandler(errors.MethodNotAllowed, []);
    }
    if (req.url !== '/metrics') {
        return monitoringEndHandler(errors.MethodNotAllowed, []);
    }
    return routeHandler(req, res, monitoringEndHandler);
}
Checks if client IP address is allowed to make http request to
S3 server. Defines function 'montiroingEndHandler', which is
called if IP not allowed or passed as callback.
@param {string | undefined} clientIP - IP address of client
@param {http.IncomingMessage} req - http request object
@param {http.ServerResponse} res - http response object
@param {RequestLogger} log - werelogs logger instance
@return {void}