-
Notifications
You must be signed in to change notification settings - Fork 321
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
feat: add tagging controller delays and work queue size metrics #1116
base: master
Are you sure you want to change the base?
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This issue is currently awaiting triage. If cloud-provider-aws contributors determine this is a relevant issue, they will accept it by applying the The 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-sigs/prow repository. |
Hi @shvbsle. Thanks for your PR. I'm waiting for a kubernetes 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-sigs/prow repository. |
pkg/controllers/tagging/metrics.go
Outdated
StabilityLevel: metrics.ALPHA, | ||
}, | ||
) | ||
workQueueSize = metrics.NewGauge( |
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.
I think we should already have an equivalent metric from the workqueue
itself:
_ "k8s.io/component-base/metrics/prometheus/workqueue" // enable prometheus provider for workqueue metrics |
they're defined here: https://github.com/kubernetes/client-go/blob/master/util/workqueue/metrics.go
and the metrics should be emitted with the Name
of the workqueue (probably a prefix?):
Name: TaggingControllerClientName, |
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.
Confirmed that we have equivalent metric for worker queue size already. They show up under the label tagging-controller
. It is this:
workqueue_depth{name="tagging-controller"} 0
Will remove workQueueSize
@@ -269,6 +274,7 @@ func (tc *Controller) process() bool { | |||
} | |||
|
|||
tc.workqueue.Forget(obj) | |||
nodeTaggingDelay.Observe(time.Since(currentNode.CreationTimestamp.Time).Seconds()) |
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.
I think we want this within tagEc2Resource, around:
klog.Infof("Successfully labeled node %s with %v.", node.GetName(), labels) |
Since we only want to record it when we're tagging (not un-tagging) and we don't want to record it unless tags are actually applied
…f tagging delay inside tagEc2Instance
@@ -342,6 +342,7 @@ func (tc *Controller) tagEc2Instance(node *v1.Node) error { | |||
|
|||
klog.Infof("Successfully labeled node %s with %v.", node.GetName(), labels) | |||
|
|||
nodeTaggingDelay.Observe(time.Since(node.CreationTimestamp.Time).Seconds()) |
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.
why node creation time? there can also be an update to the tags which would cause retag right?
If we want to know just for the current iteration we already have work queue metrics
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.
Intent is to observe tagging delays especially during the node-startup and in clusters with a large number of nodes. Since the emitted metric is a Histogram, a re-tag event would fall in Inf+ buckets. The histogram would still allow us to get a reliable p90 metric to observe delays during node-startup
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.
How would this be different from the work queue metrics as the only additional thing this might add is the time it takes to add to the workqueue which should be mostly quick/immediate. Otherwise this is mostly sum of work queue latency and work duration metrics right?
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/component-base/metrics/prometheus/workqueue/metrics.go#L55-L63
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.
Currently we are only interested in tagging delays. IIUC, workqueue_queue_duration_seconds_bucket
does not provide a way to distinguish between a tagging, an untagging or an error event, which makes it an unreliable proxy for what we want to measure.
What type of PR is this?
What this PR does / why we need it:
Adds tagging controller delays metric. This measure the delay between node-creation and tagging of the EC2 Instance. The metrics should show up like so:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: