Serve simple prometheus metrics
We need a prometheus metrics endpoint available on a dedicated network port. Callico does something similar with gunicorn.
Once the django command gunicorn is able to listen to both ports (port 80 for business app, port 3000 for metrics only), we need to create an endpoint (non-DRF, just a django view) that outputs prometheus metrics in this format, on the url http://IP:3000/metrics
:
arkindex_instance{hostname="PUBLIC_HOSTNAME", env="ARKINDEX_ENV"} 1
This will just mean that the instance is online. We can extend that later on with real stats.
Finally, the /metrics
endpoint must only be available from the prometheus port (3000). Callico also does this using a mixin.