Warning
You are currently viewing v"1.4" of the documentation and it is not the latest. For the most recent documentation, kindly click here.
This specification describes the prometheus
trigger that scales based on a Prometheus.
triggers:
- type: prometheus
metadata:
# Required
serverAddress: http://<prometheus-host>:9090
metricName: http_requests_total
threshold: '100'
query: sum(rate(http_requests_total{deployment="my-deployment"}[2m])) # Note: query must return a vector/scalar single element response
The serverAddress
indicates where Prometheus is running which contains the configured metric defined in metricName
or query
. If using VictoriaMetrics cluster version, set full URL to Prometheus querying API, e.g. http://<vmselect>:8481/select/0/prometheus
Not supported yet.
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
name: prometheus-scaledobject
namespace: default
spec:
scaleTargetRef:
deploymentName: my-deployment
triggers:
- type: prometheus
metadata:
serverAddress: http://<prometheus-host>:9090
metricName: http_requests_total
threshold: '100'
query: sum(rate(http_requests_total{deployment="my-deployment"}[2m]))