Follow this tutorial on how to implement a Prometheus exporter in Python: https://medium.com/@dast04/writing-custom-prometheus-exporters-in-python-kubernetes-73626b66d78c