-
Notifications
You must be signed in to change notification settings - Fork 3
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
Job runner details #124
base: main
Are you sure you want to change the base?
Job runner details #124
Conversation
36f6e1a
to
5572724
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution @apj0nes! It's very much appreciated.
Added a couple of comments check them out and let's make this PR move forward 🚀
Cheers!
|
||
Metrics are labelled with the runner type. The logic for determining the runner type is as follows - | ||
|
||
If the runner tag is in the [github_hosted_runner_labels](./gh_actions_exporter/config.py) list the runner type will be `github-hosted` else the runner type will be `self-hosted`. Additional `github-hosted` runner tags can be added via config. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how the doc was rendered (through mkdocs or github), through github at least couldn't get it to redirect unless I go up a couple of folders.
Also added some note for my future self as I was wondering how we could handle GitHub hosted larger runners with this setting.
If the runner tag is in the [github_hosted_runner_labels](./gh_actions_exporter/config.py) list the runner type will be `github-hosted` else the runner type will be `self-hosted`. Additional `github-hosted` runner tags can be added via config. | |
- If the runner tag is in the [github_hosted_runner_labels](../../gh_actions_exporter/config.py) | |
list, the runner type will be `github-hosted` else the runner type will be `self-hosted`. | |
- Additional `github-hosted` runner tags can be added via the config file, | |
for example GitHub hosted larger runners as their name is defined | |
by the owner of the GitHub organization. |
@@ -25,6 +25,7 @@ def __init__(self, settings: Settings): | |||
self.job_labelnames = self.common_labelnames.copy() + [ | |||
"job_name", | |||
"runner_type", | |||
"runner_labels", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of query or filter were you trying to do when deciding to add the runner_labels
and have you tried using the relabel option?
I see no issue in adding it, just wanna make sure you tried all the options available to you.
For example in our org, our self-hosted runners are defined with multiple labels:
- The os (
ubuntu-20.04
) - The flavor (
large
) - And in some case the cloud provider (
aws
,azure
, etc)
And we use the relabel feature to retrieve those value and create new label like:
cloud=aws
flavor=large
Which makes it easier for us to query around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does look promising. Would you have an example yaml config for achieving the example above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do yes, this is an example of what we've been playing with:
job_relabelling:
- label: cloud
default: github-hosted
values:
- azure
- aws
type: name # retrieve the info from the runner name (defaults to labels).
- label: image
default: unknown
values:
- ubuntu-latest
- ubuntu-20.04
- ubuntu-22.04
- rocky-8
- redhat-8
- redhat-9
- label: flavor
default: medium # consider github-hosted flavors as medium
values:
- small
- medium
- large
- xlarge
And sorry for the lack of documentation on those 😅 , I'll take note on my end and make an effort towards that in the coming days.
Resolves #125
This change amends the job runner_type label logic as not all self-hosted runners may contain the
self-hosted
runs-on label. For example users of Warpbuild with have a runs-on label ofwarp-*
but I would consider this self-hosted (non-github hosted runners). In addition to this, the runs-on labels have been added to job metrics as a new label (comma-separated).This change should provide more insight into which runners are running which job.
Note: Github hosted runners list, this can be defined via config if the list becomes outdated and also allows users who user larger runners to add their runner labels.