-
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
base: main
Are you sure you want to change the base?
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.
|
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 this PR. I left some comments, we definitely need some docs about new metrics and I would like to understand if the change is backwards compatible.
pkg/pipelinerunmetrics/metrics.go
Outdated
runningPRTag, err := getRunningPipelineRunTags(cfg) | ||
if err != nil { | ||
return err | ||
} |
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.
NIT: It looks a bit strange to have some of the config processing logic directly in the viewRegister
and some in a separate getRunningPipelineRunTags
function.
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.
Earlier logic is to get tags for PipelineRuns and new logic is to get RunningPipelineRun tags.
Now we have 2 options here.
extract older logic to new function just like we did it for running PRs or keep the new logic in view register only.
I will prefer former as that offers more clean code.
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.
If the function is used in more than one place or if you write unit tests for it I see how it helps, otherwise I think we don't need a separate function
pkg/pipelinerunmetrics/metrics.go
Outdated
case config.PipelinerunLevelAtPipelinerun: | ||
tags = []tag.Key{pipelinerunTag, pipelineTag, namespaceTag} |
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.
If I read this right this counts how many PipelineRuns
are running for a certain PipelineRun
, i.e. 0 or 1?
I'm not sure I understand the value of this metric, it would be completely non-aggregated - is the intention to use this to build a graph of which pipeline is running at a certain point in time?
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.
aggregation is being done in RunningPipelineRuns function.
intention is get count of running PRs in current time only. There is no intention of getting the historical data on the same.
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 |
1 similar comment
/retest |
aa38559
to
b0679b0
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.
|
b0679b0
to
7891813
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
7891813
to
d3be2f8
Compare
Currently metrices shown for Running Pipeline Count is at cluster level. There is no way we can get that metric at namespace or pipeline level. We have enhanced the running pipelinerun metric at pipelinerun, pipeline and namespace level (Can be configured via ConfigMap, Default behaviour is same as earlier).
d3be2f8
to
a73f04d
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.
|
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