-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 Metrics for Running PipelinesRuns at Pipeline and Namespace level #8280
Conversation
Hi @pramodbindal. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
/ok-to-test
/kind feature |
/test check-pr-has-kind-label |
@khrm: The specified target(s) for
The following commands are available to trigger optional jobs:
Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/test pull-tekton-pipeline-build-tests |
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.
@pramodbindal can you squash your commits ? Otherwise LGTM.
b802e66
to
6951973
Compare
Done |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
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.
- We might want to add a release note entry
- It seems it needs to be rebased ?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@pritidesai @abayer |
5c2ef54
to
4a05727
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/retest |
785e2e6
to
d1757a6
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
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, this looks good!
My only ask is to extend the test to cover the various config options that you introduced, since right now only one out of four options is tested.
newPipelineRun(corev1.ConditionUnknown, "testns1"), | ||
newPipelineRun(corev1.ConditionUnknown, "testns2"), | ||
newPipelineRun(corev1.ConditionUnknown, "testns2"), | ||
newPipelineRun(corev1.ConditionUnknown, "testns3"), | ||
newPipelineRun(corev1.ConditionUnknown, "testns3"), | ||
newPipelineRun(corev1.ConditionUnknown, "testns3"), | ||
newPipelineRun(corev1.ConditionUnknown, "testns3"), |
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 introducing more namespaces. This way the test checks that aggregation is happening at the namespace level. It does not check anymore that the filtering of the completed pipeline runs - is there a reason you removed them?
} | ||
} | ||
|
||
ctx = getConfigContextRunningPRLevel("pipeline") |
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.
The configuration is set to "pipeline" but all PipelineRuns
use the same "anonymous" pipeline, so this setting is not fully tested. What is verified is aggregation at namespace level and the tagging at pipeline level.
if !pr.IsDone() { | ||
countMap[pipelineRunKey]++ | ||
metrics.Record(ctx_, runningPRs.M(float64(countMap[pipelineRunKey]))) |
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.
As discussed, we'll keep this as it is for now.
I still think that recording once the correct value would be better than recording incremental values, but we can address that separately.
if err := recorder.RunningPipelineRuns(informer.Lister()); err != nil { | ||
t.Errorf("RunningPipelineRuns: %v", err) | ||
} | ||
metricstest.CheckLastValueData(t, "running_pipelineruns", map[string]string{"namespace": "testns", "pipeline": "anonymous"}, 1) |
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.
We should have one test per level in this PR. You can easily make this a matrix test with three fields:
- the list of pipelineruns
- the config level
- a list of map[string]string -> int for expected values
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
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.
Thanks for adding this and for all the updates!
/lgtm
/hold cancel |
We have added the PipelineRun metric at pipeline and namespace level. Fix Lint Error Fix Lint Error Adding Tests for better coverage of different running-pipelinerun use cases. Fix Lint
673ad56
to
e596d5e
Compare
/lgtm |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
Changes
""
. but it can be set tonamespace
orPipelinerun
.Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes