-
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
Expose prometheus metrics at ScaledJob like ScaledObject #4817
Conversation
Thank you for your contribution! 🙏 We will review your PR as soon as possible.
While you are waiting, make sure to:
Learn more about: |
b182ddb
to
9a45df4
Compare
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.
Thanks for the contribution!
As the goal is adding new metrics, we should create new counters here for them and update those counters instead of reusing already existing counters for ScaledObjects. Otherwise, It could be confusing
Thanks for the feedback. I will update the code again. |
90e34f5
to
175badd
Compare
@JorTurFer |
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.
We can't rename the already existing metrics because that's a breaking change and our deprecation policy requires 2 version between deprecation and removal.
I'm thinking in 2 different option for this:
- Use a new label to inform if it's ScaledObject or ScaledJobs on metrics where the name isn't clear, such as 'keda_scaler_active' or
keda_scaler_metrics_value
, and duplicating the metrics with clear name, for examplekeda_scaled_object_errors
withkeda_scaled_job_errors
- Duplicate all the metrics for the ScaledJobs
In both cases, we should maintain current metrics, but I'm not sure about which is the best approach for new metrics, I don't have any strong opinion but personally I prefer the labels option. WDYT @kedacore/keda-core-contributors ?
In any case, we have to add e2e test coverage to these metrics: https://github.com/kedacore/keda/blob/main/tests/sequential/prometheus_metrics/prometheus_metrics_test.go
pkg/prommetrics/prommetrics.go
Outdated
scaledJobScalerMetricsValue = prometheus.NewGaugeVec( | ||
prometheus.GaugeOpts{ | ||
Namespace: DefaultPromMetricsNamespace, | ||
Subsystem: "scaler", | ||
Name: "metrics_latency", | ||
Name: "scaledjob_metrics_value", | ||
Help: "Metric Value used for HPA", | ||
}, | ||
scaledJobmetricLabels, | ||
) |
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.
This metrics isn't needed. The ScaledJob doesn't generate an HPA
You are right. I should have taken a look, because It conflicts with document(https://keda.sh/docs/2.11/operate/prometheus/). |
@JorTurFer
Do I understand right? |
Sorry for the slow response (the summer break xD) No, I meant that metrics like For labels whose have scaledobject in the naming such us For example, this metric is the same for both, splitting them based on |
d664edf
to
9459287
Compare
@JorTurFer |
b6167c2
to
e571d99
Compare
Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
…edacore#4814) Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]> Signed-off-by: Yoon Park <[email protected]>
…acore#4839) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Yoon Park <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Yoon Park <[email protected]>
…core#4856) Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
Co-authored-by: Jorge Turrado <[email protected]> Co-authored-by: Jorge Turrado <[email protected]> Signed-off-by: Yoon Park <[email protected]>
* Add testing strategy document Signed-off-by: Jorge Turrado <[email protected]> Signed-off-by: Jorge Turrado <[email protected]> * Update TESTING.md Signed-off-by: Jorge Turrado <[email protected]> * Update TESTING.md Signed-off-by: Jorge Turrado <[email protected]> * add extra info to tests Signed-off-by: Jorge Turrado <[email protected]> --------- Signed-off-by: Jorge Turrado <[email protected]> Signed-off-by: Jorge Turrado <[email protected]> Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: SpiritZhou <[email protected]> Signed-off-by: Yoon Park <[email protected]>
`s/deployment/statefulset` in `pkg/scaling/resolver/scaling_resolver.go` for the StatefulSet scaling resolver error message. Signed-off-by: David Morrison <[email protected]> Signed-off-by: Yoon Park <[email protected]>
…dacore#4909) Signed-off-by: Yoon Park <[email protected]>
* Update Signed-off-by: SpiritZhou <[email protected]> * Update Signed-off-by: SpiritZhou <[email protected]> * Update Signed-off-by: SpiritZhou <[email protected]> * Update Signed-off-by: SpiritZhou <[email protected]> * Update CHANGELOG.md Co-authored-by: Jorge Turrado Ferrero <[email protected]> Signed-off-by: SpiritZhou <[email protected]> * Update Signed-off-by: SpiritZhou <[email protected]> * Update Signed-off-by: SpiritZhou <[email protected]> * Update Signed-off-by: SpiritZhou <[email protected]> * Update Signed-off-by: SpiritZhou <[email protected]> * Update Signed-off-by: SpiritZhou <[email protected]> * Update Signed-off-by: SpiritZhou <[email protected]> * Update CHANGELOG.md Signed-off-by: SpiritZhou <[email protected]> --------- Signed-off-by: SpiritZhou <[email protected]> Co-authored-by: Jorge Turrado Ferrero <[email protected]> Signed-off-by: Yoon Park <[email protected]>
…ore#4900) Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
Signed-off-by: Yoon Park <[email protected]>
0fd9310
to
1e7c6b1
Compare
Semgrep found 8
An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. Ignore this finding from third-party-action-not-pinned-to-commit-sha. |
Using GitHub sync break the changes. |
I opened a new PR here. |
Provide a description of what has been changed
Expose prometheus metrics at ScaledJob like ScaledObject
Refer to : #4798
Checklist
Fixes #
#4798
Relates to #