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

✨ Add a separate registry for workqueue metrics #2671

Closed
Closed
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
18 changes: 11 additions & 7 deletions pkg/metrics/workqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,18 @@ var (
}, []string{"name"})
)

var WorkqueueRegistry = prometheus.NewRegistry()

func init() {
Registry.MustRegister(depth)
Registry.MustRegister(adds)
Registry.MustRegister(latency)
Registry.MustRegister(workDuration)
Registry.MustRegister(unfinished)
Registry.MustRegister(longestRunningProcessor)
Registry.MustRegister(retries)
WorkqueueRegistry.MustRegister(depth)
WorkqueueRegistry.MustRegister(adds)
WorkqueueRegistry.MustRegister(latency)
WorkqueueRegistry.MustRegister(workDuration)
WorkqueueRegistry.MustRegister(unfinished)
WorkqueueRegistry.MustRegister(longestRunningProcessor)
WorkqueueRegistry.MustRegister(retries)

Registry.Register(WorkqueueRegistry)
Copy link
Member

Choose a reason for hiding this comment

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

I understand the problem, but this means that the workqueue metrics will disappear for all existing users. That is not an option. We need to find a solution that does not break existing users.

/hold

Copy link
Author

Choose a reason for hiding this comment

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

Hey @alvaroaleman , these metrics won't disappear actually. We are adding those metrics back to the main Registry with Registry.Register(WorkqueueRegistry). So this won't affect anything for existing users.


workqueue.SetProvider(workqueueMetricsProvider{})
}
Expand Down