I am trying to write a Heroku auto scaling script. I want to base the auto scaling on the memory usage, dyno load and response time metrics that are available on the dashboard.
However I am not able to find an API endpoint in their documentation that will give me metrics data.
The closest thing that I was able to find is a log-runtime-metrics, a Heroku Labs module, that writes the CPU and memory usage in the syslog every 20 seconds.
I then need to fetch and parse the log in order to get some meaningful data. See this answer.
Is there an API for this? Or a better way of doing it?