Guard metrics collector with mutex#186
Conversation
|
Hi @ghdrope. Thanks for your PR. I'm waiting for a kcp-dev 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. DetailsInstructions 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. |
9dc680a to
08a7ba4
Compare
|
LGTM label has been added. DetailsGit tree hash: d32980f2f59971dadc8e8dbf6189ef948b725759 |
|
/ok-to-test |
|
/retest infra failure |
|
/retest |
08a7ba4 to
dc60979
Compare
|
New changes are detected. LGTM label has been removed. |
|
/retest |
|
/retest |
1 similar comment
|
/retest |
|
@ghdrope Could you rebase the pr? Thanks! |
|
/remove-kind documentation |
|
I lost track of this one, my bad. Sure, I can rebase it @ntnn, I’ll do it later today after work hours. |
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Signed-off-by: ghdrope <0coasts-gearing@icloud.com>
Signed-off-by: ghdrope <0coasts-gearing@icloud.com>
* implement initial support for external virtual workspaces On-behalf-of: @SAP christoph.mewes@sap.com * use unrealistically low resource requests to help squeeze more out of our CI nodes * PR feedback from Copilot
4236a41 to
6dd1750
Compare
Signed-off-by: ghdrope <0coasts-gearing@icloud.com>
6dd1750 to
f9034fc
Compare
|
Now that I look at it, are we even sure the Collect() function is called? From what I can see in the main(), each individual metric is registered with the default collector, and our MetricsCollector is purely a goroutine to update those metrics. I do not think the mutex will actually do anything right now, unless we use our MetricsCollector as a "native" Prometheus collector, no? |
Summary
Make
MetricsCollectorthread-safe and prevent metric disappearance during Prometheus scrapes by adding async.RWMutexand aCollect()method.Note: Also added
defer ticker.Stop()and commenting.What Type of PR Is This?
/kind bug
/kind cleanup
/kind documentation
Related Issue(s)
Fixes #160
Release Notes