Skip to content
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

Enable prometheus provider for workqueue metrics #754

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pkg/controllers/tagging/tagging_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ import (
opt "k8s.io/cloud-provider-aws/pkg/controllers/options"
awsv1 "k8s.io/cloud-provider-aws/pkg/providers/v1"
nodehelpers "k8s.io/cloud-provider/node/helpers"
_ "k8s.io/component-base/metrics/prometheus/workqueue" // enable prometheus provider for workqueue metrics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh cool, didn't realize this was all done with side effects via init

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah assuming these built-in metrics do the job, I'd like to get rid of the other ones we have after 1.29 is cut. The workqueue should track processing time (dequeue latency), errors, size, etc.

"k8s.io/klog/v2"
)

func init() {
registerMetrics()
}

// workItem contains the node and an action for that node
type workItem struct {
node *v1.Node
Expand Down Expand Up @@ -126,14 +131,13 @@ func NewTaggingController(
rateLimitEnabled = false
}

registerMetrics()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed this was here, it belongs in init IMO.

tc := &Controller{
nodeInformer: nodeInformer,
kubeClient: kubeClient,
cloud: awsCloud,
tags: tags,
resources: resources,
workqueue: workqueue.NewNamedRateLimitingQueue(rateLimiter, "Tagging"),
workqueue: workqueue.NewNamedRateLimitingQueue(rateLimiter, TaggingControllerClientName),
nodesSynced: nodeInformer.Informer().HasSynced,
nodeMonitorPeriod: nodeMonitorPeriod,
rateLimitEnabled: rateLimitEnabled,
Expand Down
Loading