[Feature] Optionally export metrics for Prometheus

/metrics could export metrics in the prometheus.io format.

I am not familiar with Python, but there seems to be a library available.

Why did you mention Python? We only use it for CI tests, there is no python code in our code base.