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 metric to count number of sync calls #1692
Conversation
Signed-off-by: Michael Tsang <michael.tsang@jetstack.io>
Signed-off-by: Michael Tsang <michael.tsang@jetstack.io>
Signed-off-by: Michael Tsang <michael.tsang@jetstack.io>
@@ -63,6 +64,7 @@ type Controller struct { | |||
|
|||
watchedInformers []cache.InformerSynced | |||
queue workqueue.RateLimitingInterface | |||
metrics *metrics.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.
Each controller shouldn't need its own pointer to metrics, and if it does then I think they should all point to the same actual instantiation 😄
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 have removed them all to just call with the global metrics.Default
, except for the certificates controller which already had a metrics
pointer. However I'm not sure if this controller needs this anyway since this is just an alias for the same metrics.Default
.
Additionally I don't quite understand the need for the Prometheus metrics to be exposed globally themselves in the metrics.go
file since they can be accessed via the global metrics.Default
anyway, unless this is a requirement for Prometheus.
Signed-off-by: Michael Tsang <michael.tsang@jetstack.io>
Looks good! 😄 /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cheukwing, munnerz 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 |
/retest |
11 similar comments
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
13 similar comments
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
What this PR does / why we need it:
Adds a Prometheus metric to count the number of
Sync()
calls for each controllerWhich issue this PR fixes: fixes #1001
Special notes for your reviewer:
Each controller struct holds a
metrics
field, following the existing field in thecertificates
controller struct.However since
Default
can be accessed globally and is the same as each of thesemetrics
fields, I am not sure if it is actually needed.Release note: