On large deviation principles in metric spaces