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

Chore: Update Scaler Target Calculation in Grafana Dashboard #5433

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

atilsensalduz
Copy link
Contributor

@atilsensalduz atilsensalduz commented Jan 25, 2024

This pull request addresses an issue with the calculation of scaler target values in the Grafana dashboard. Currently, the calculation is done using the rate function over a 5-minute period, but the metric is of type gauge. This can lead to inaccurate target values being displayed on the dashboard.

Provide a description of what has been changed

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO - learn more)

Fixes #

Relates to #

…alculation on Scale Target

Signed-off-by: atilsensalduz <atil.eren@outlook.com>
@atilsensalduz atilsensalduz requested a review from a team as a code owner January 25, 2024 07:17
@atilsensalduz
Copy link
Contributor Author

I propose modifying the PromQL expression in the Grafana dashboard to directly use the gauge metric without aggregating it with the rate function over a 5-minute period.

NAME                              REFERENCE                              TARGETS       MINPODS   MAXPODS   REPLICAS   AGE
keda-hpa-scaled-object  StatefulSet/sts       96/90, 9/60   3         8         4          121m

For example, while the HPA indicates the current target value as 96, the dashboard displays a maximum of 80% when calculating the scaled target with the rate function. However, when calculating it without the rate function, the dashboard shows the actual current value that aligns with what the HPA indicates.

sum by(metric) (rate(keda_scaler_metrics_value{exported_namespace=~\"$namespace\", metric=~\"$metric\", scaledObject=\"$scaledObject\"}[5m]))

image

sum by(metric) (keda_scaler_metrics_value{exported_namespace=~\"$namespace\", metric=~\"$metric\", scaledObject=\"$scaledObject\"})
image

@atilsensalduz
Copy link
Contributor Author

Hey @JorTurFer,

Could you help me out with the review process for my PR? Any guidance would be awesome!

Thanks,

@JorTurFer
Copy link
Member

Wow, I missed this PR totally 😱
Sorry :( I'll check this today

@JorTurFer
Copy link
Member

I've testes the change in my own cluster and the values changes significantly (as it's expected):
image

Honestly, in my mind the change makes sense totally because the panel's name is Scaler Metric Value so I'd not expect any aggregation watching the results.

@JorTurFer
Copy link
Member

/skip-e2e

@JorTurFer JorTurFer enabled auto-merge (squash) February 29, 2024 16:28
@JorTurFer JorTurFer enabled auto-merge (squash) February 29, 2024 16:28
@JorTurFer JorTurFer merged commit c6797f6 into kedacore:main Feb 29, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants