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
Add more labels to metrics-server metrics #2176
Comments
+1 fyi I'm workarounding this by using hook as follows but it would be more awesome if it's supported in metrics-server natively NOTE: BEFORE USE BELOW SNIPPET, READ THIS COMMENT! #!/bin/bash -x
kubectl -n actions-runner-system label pod $RUNNER_NAME \
actor=$(echo $GITHUB_ACTOR | sed 's/[^a-zA-Z0-9_.-]//g') \
repo=$(echo $GITHUB_REPOSITORY | cut -d/ -f2 | sed 's/[^a-zA-Z0-9_.-]//g') \
job=$(echo $GITHUB_JOB | sed 's/[^a-zA-Z0-9_.-]//g') \
runner=$(echo $RUNNER_NAME | sed 's/[^a-zA-Z0-9_.-]//g') \
sha=$GITHUB_SHA \
attempt=$GITHUB_RUN_ATTEMPT \
run_id=$GITHUB_RUN_ID NOTE: BEFORE USE ABOVE SNIPPET, READ THIS COMMENT! |
it will be great to include branch name also |
@hamishforbes @0xF4D3C0D3 @timansky Hey! |
I'm a bit concerned about cardinality explosion #2218 (comment) but perhaps it won't be a huge problem as long as you won't have hundreds of workflows running against hundreds of branches... (which would result in dozens of thousands more time-series generated and stored. |
@hamishforbes @0xF4D3C0D3 @timansky It would be great if you could also check #2359 by @kkaresz-tw and add 👍, comments, and/or feedback! |
@0xF4D3C0D3 Hey! Thanks for sharing your workaround. It does look great and helps many folks not yet using a custom build of ARC (as we didn't cut even a new release that contains #2218 yet...) After carefully reviewing your hook script, I realized you included You may already know, but here's an excerpt from the official Prometheus documentation for your convenience:
|
@mumoshu Thanks! for letting me know that. I didn't know that risk D: fortunately, I'm in not that big team so I haven't experience any regressions yet, it would be problem later indeed. To be honest, I was using prometheus as a black box or a cargo cult 😳 (I could check the cardinality by |
Sorry haven't had a chance to look at any of this stuff again yet. Ideally I think these labels would be configurable (kube-state-metrics is a high-profile example of this with I have branch enable in my custom build too, its definitely good for being able to catch when changes in a branch are causing long build/test runs! |
Thank you for your comments everyone! I've just merged #2225. It includes It doesn't include |
@mumoshu regarding the missing |
Hi @mumoshu I open a PR #2549 to use the branch_name in the metrics according to the changes from @kkaresz-tw above |
What would you like added?
The metrics emitted from the metrics-server currently only include
job
andruns_on
labels.I think
repository
is required at a minimum for this to be useful, and probablyorganisation
too?[edit]
Actually
workflow_name
is probably required as wellAlthough workflow name has only just been added to the go-github library!
[/edit]
Why is this needed?
If I have 2 Github repos (
A
andB
) and they both have a workflow jobs calledtest
andbuild
(for example) the metrics aren't differentiated, I have no idea how many test jobs ran for repo A vs repo B, only how many ran for all of them.We would get metrics like:
To be useful we'd want:
The text was updated successfully, but these errors were encountered: