Skip to content

GHA runners collector #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

njasm
Copy link
Contributor

@njasm njasm commented Nov 21, 2020

WIP. Don't merge yet. depends on landing of #12 to rebase.

Will close #11

Still need some cleaning, and eventually move some common code (with Rate limit collector) to a new module. ex. http client code

  • Added config var MONITORBOT_RUST_ORG_TOKEN that needs to contain the org's repo scoped token to be used to query GHA runners status
  • Added config var MONITORBOT_RUNNERS_REPOS that will contain the org's repositories to track GHA runners. multiple repos allowed as long as they are under the same org's umbrella. ex syntax: rust-lang/rust,rust-lang/cargo,rust-lang/rust-clippy
  • Added config var MONITORBOT_GHA_RUNNERS_REFRESH that's the refresh rate frequency (in seconds) to update the cached data about the runners statuses. default value is currently 120

current output:
image

@njasm njasm force-pushed the feature_gha_runners branch from a55d37a to e9d5f17 Compare November 29, 2020 01:20
@njasm
Copy link
Contributor Author

njasm commented Nov 29, 2020

this last push already have a fix for #14

  • I've added a mechanism that every time monitorbot starts and before hitting the api with the token for the username, we first check if the token is flagged (aka: no more api requests available to make at present time) or if we still have requests allowed to make. if at least one is flagged, the application starts but the collector fires a background task to check if we can initialize the uninitialized metrics for the flagged tokens. eventually all tokens will be available as metrics to be scraped.

  • As soon as no more uninitialized metrics exist from flagged tokens that background task returns.

  • With the above changes, I've also put the metric's vec field behind an Arc<Rwlock<<>>.

@pietroalbini Sorry for mixing both issues in one PR, but since I was refactoring some minor things I took the chance and went forward and introduced this mechanism for the issue #14. (I got excited and kept writing code 😅)

If you feel it's too much or you prefer to review two independent PRs, feel free to ping me in zulip or here, and when I have the time I'll try to split this one into two or as you see fit.

thanks!

@njasm njasm changed the title WIP: GHA runners collector GHA runners collector Nov 29, 2020
@pietroalbini
Copy link
Member

Thanks for the PR! Splitting this into two separate PRs would indeed be useful: I don't have a lot of time this week, and while I can probably review a smaller PR without issues this would take too much time.

@njasm
Copy link
Contributor Author

njasm commented Dec 7, 2020

Ok, will split those into two separate PRs when I get a change. But right know with Xmas things are a little crazy to get some time free, so I can't really compromise on a time frame for those for the very near future right now.

@njasm
Copy link
Contributor Author

njasm commented Mar 14, 2021

this PR is superseded by #15

@njasm njasm closed this Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement monitoring for self-hosted GHA runners
2 participants