Explain how you would configure a horizontal pod autoscaler in Kubernetes based on custom metrics rather than standard CPU or memory usage.