-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: Provide Prometheus metrics for total number of custom resources. #3719
Conversation
I'll update the tests and the docs after I also send PRs for #2637, #2638, if it's alright? |
Fine for me. Changed PR description not to close the issue |
I'll be sending that PR after this one has been merged as it'll build on some changes I made here. |
@JorTurFer @tomkerkhove Any thoughts on this PR? I need this to be merged before working on the others as it will build on the changes here. Don't want to duplicate them across PRs. |
Sorry, I'm a bit busy atm, I'll take a look today or max tomorrow :( |
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.
Looking good
Can we add this new metric to the metrics e2e test?
I was planning on updating tests after adding prometheus metrics for all CRDs. |
Yeah, I think a finalizer would be a "cleaner" solution. Also helps in futureproofing, if more complex metrics / features are to be added. |
Actually, never mind. I'll just try to do all crd metrics and e2e test in this PR itself considering they're very coupled. @JorTurFer |
No worries, you can add the e2e test in another PR with all the metrics |
My only concern is about the finalizer, maybe we should add it due to is clearer, atm we are already using them in other resources. WDYT @zroubalik ? Is this an overkill? |
I also agree that the finalizers are cleaner than calling the method under the error block. |
Added metrics for all custom resources - SOs, SJs, TAs, CTAs, and updated the e2e test as well. |
Docs PR - kedacore/keda-docs#954 |
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.
Looking good
Could you move new finalizers to split files (like in case of so/sj). It's the code it's clearer 😄
/run-e2e |
Moved them to separate files. Had to pull out code into common functions because the linter was complaining about duplicate code. Struggled a bit with the Go type system, before declaring an interface that both reconcilers satisfy to avoid having ugly switch cases in the common code. |
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.
LGTM!
Awesome job ❤️
Due to there are changes in the controllers part, let's wait till @zroubalik takes a look too
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.
See kedacore/keda-docs#954 (comment) but basically I think it's a lot more user-friendly if we have 4 metrics:
keda_operator_scaledobject_totals
- Total number of KEDA ScaledObjects per namespace resources.keda_operator_scaledjobs_totals
- Total number of KEDA ScaledJobs per namespace resources.keda_operator_triggerauthentication_totals
- Total number of KEDA TriggerAuthentication per namespace resources.keda_operator_clustertriggerauthentication_totals
- Total number of KEDA ClusterTriggerAuthentication resources.
@JorTurFer @zroubalik can you please share your thoughts on this so that we can make the changes that are required (if need be)? |
Let's discuss in the docs PR directly to have only one thread about this 😄 |
Signed-off-by: Vighnesh Shenoy <[email protected]>
Signed-off-by: Vighnesh Shenoy <[email protected]>
Signed-off-by: Vighnesh Shenoy <[email protected]>
Signed-off-by: Vighnesh Shenoy <[email protected]>
Signed-off-by: Vighnesh Shenoy <[email protected]>
Signed-off-by: Vighnesh Shenoy <[email protected]>
Signed-off-by: Vighnesh Shenoy <[email protected]>
Signed-off-by: Vighnesh Shenoy <[email protected]>
Signed-off-by: Vighnesh Shenoy <[email protected]>
Signed-off-by: Vighnesh Shenoy <[email protected]>
Signed-off-by: Vighnesh Shenoy <[email protected]>
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.
Looking good! just a small nit about using constants as suggested in CTA_controller.
Signed-off-by: Vighnesh Shenoy <[email protected]>
/run-e2e prometheus* |
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.
great feature!
Signed-off-by: Vighnesh Shenoy <[email protected]>
/run-e2e prometheus* |
/run-e2e prometheus* |
Can this be merged now? @JorTurFer |
yes, sorry, this was ready to be merged |
Docs PR - kedacore/keda-docs#954
Checklist
Relates to #2637, #2638, #2639