github_actions_exporter icon indicating copy to clipboard operation
github_actions_exporter copied to clipboard

Poll Actions Runner API for gauge metrics on runner pools

Open janakerman opened this issue 2 years ago • 4 comments

Perhaps it would make sense to add support for metrics on self-hosted runners using the Github Actions API? It would be possible to export gauge metrics showing the numbers of online/offline & busy/idle runners for a runner group within an organisation/enterprise.

Adding more functionality based on polling comes with the increased potential of hitting API rate limits. The minimum Github App limits (5000 per hour) this works out at about ~80 requests per minute which is probably sufficient for most use cases. If it became an issue we could

  • Providing configurable polling frequency
  • Conditional HTTP requests (If-None-Match)
  • Exporting Github rate limit usage (maybe useful anyway!)

Docs:

  • https://docs.github.com/en/rest/actions/self-hosted-runners
  • https://docs.github.com/en/rest/actions/self-hosted-runner-groups

janakerman avatar Apr 20 '22 22:04 janakerman

sounds a great idea!

cpanato avatar May 02 '22 13:05 cpanato

Hello @cpanato ! Any update on this issue? I am looking to get metrics for self-hosted github runners and this exporter doesn't seem to provide metrics for self-hosted yet.

apoorva-marisomaradhya avatar Sep 07 '23 18:09 apoorva-marisomaradhya

@apoorva-marisomaradhya sorry for the delay, is something you would like to contribute?

cpanato avatar Jan 20 '24 09:01 cpanato

Hi! I would love to add metrics for self-hosted runners, that would come in handy for sure. I can put up a PR for it in the next few days.

peterhalasz avatar Jan 31 '24 20:01 peterhalasz