Conversation
36f6e1a to
5572724
Compare
|
|
||
| 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.
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. |
| self.job_labelnames = self.common_labelnames.copy() + [ | ||
| "job_name", | ||
| "runner_type", | ||
| "runner_labels", |
There was a problem hiding this comment.
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=awsflavor=large
Which makes it easier for us to query around.
There was a problem hiding this comment.
This does look promising. Would you have an example yaml config for achieving the example above?
There was a problem hiding this comment.
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
- xlargeAnd 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-hostedruns-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.