Skip to content

Prometheus threshold semantics #3035

Answered by kefik
kefik asked this question in Q&A / Need Help
May 11, 2022 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

After playing with the threshold value, I found out it is the value that is set as desiredMetricValue of HorizontalPodAutoscaler (HPA)
https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/

Plus, as stated in documentation Prometheus scaler is working with average values only, also mentioned here:
#1881

And the HPA scaling then follows this equation:
desiredReplicas = ceil[currentReplicas * ( currentMetricValue / desiredMetricValue )]

Where desiredMetricValue is the threshold in Prometheus scaler configuration.
currentMetricValue is then the value obtained from Prometheus (according to query) divided by the number of currently existing replicas.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@kefik
Comment options

@kefik
Comment options

@zroubalik
Comment options

@carillonator
Comment options

Answer selected by kefik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants