-
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 namespace label/tag to non-deprecated throttle metrics #7879
Conversation
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
1f01335
to
c980ba4
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
c980ba4
to
35c90d3
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
ping @khrm - can you take a look when you get the chance? also, see my question in the description wrt if adding labels to existing experimental metrics is "OK" |
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 can add this behind a flag also. Like we do for count.reason
Before I make the change, how about an early review on the name .... say
for the new flag's name @khrm ? Thanks for the pointer. |
35c90d3
to
ab4ea8f
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
ok @khrm new flag to enable the namespace label on the throttle metric is added ... PTAL |
ab4ea8f
to
785e820
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 @gabemontero
/lgtm
likewise thanks @afrittoli question to you and @khrm - any suggestion on who I should reach out to in order to get the approve label (minimally assuming @khrm you are fine with my updates from your comments) ? |
pkg/taskrunmetrics/metrics.go
Outdated
|
||
for ns, cnt := range trsThrottledByQuota { | ||
ctx, err = tag.New(ctx, []tag.Mutator{tag.Insert(namespaceTag, ns)}...) |
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 doesn't behave properly for metrics.taskrun.throttle.enable-namespace
: false.
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.
good catch ... I've updated the code path and unit test to cover both flavors of the new config option - thanks
Yes, this is fine. |
785e820
to
db76fe0
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
Back when implementing tektoncd#6744 for tektoncd#6631 we failed to realize that with k8s quota policies being namespace scoped, knowing which namespace the throttled items were in could have some diagnostic value. Now that we have been using the metric added for a bit, this realization is now very apparent. This changes introduces the namespace tag. Also, since last touching this space, the original metric was deprecated and a new one with a shorter name was added. This change only updates the non-deprecated metric with the new label. Lastly, the default behavior is preserved, and use of the new label only occurs when explicitly enabled in observability config map.
db76fe0
to
7bccfad
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
unrelated flake on alpha integration /test pull-tekton-pipeline-alpha-integration-tests |
@afrittoli @khrm PTAL at the updates from @khrm 's last review - thanks |
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.
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afrittoli, khrm 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 |
/lgtm |
Changes
Back when implementing #6744 for #6631 we failed to realize that with k8s quota policies being namespace scoped, knowing which namespace the throttled items were in could have some diagnostic value.
Now that we have been using the metric added for a bit, this realization is now very apparent.
This changes introduces the namespace tag. Also, since last touching this space, the original metric was deprecated and a new one with a shorter name was added. This change only updates the non-deprecated metric with the new label.
Lastly, the default behavior is preserved, and use of the new label only occurs when explicitly enabled in observability config map.
Fixes #7878
/kind feature
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