Metrics
The metric configuration defines which metric type is watched by the Autoscaler.
Setting metrics per revision
For per-revision configuration, this is determined using the autoscaling.knative.dev/metric
annotation. The possible metric types that can be configured per revision depend on the type of Autoscaler implementation you are using:
- The default KPA Autoscaler supports the
concurrency
andrps
metrics. - The HPA Autoscaler supports the
concurrency
,rps
andcpu
metrics.
For more information about KPA and HPA, see the documentation on Supported Autoscaler types.
- Per-revision annotation key:
autoscaling.knative.dev/metric
- Possible values:
"concurrency"
,"rps"
or"cpu"
, depending on your Autoscaler type. Thecpu
metric is only supported on revisions with the HPA class. Default:
"concurrency"
- Per-revision rps configuration
- Per-revision cpu configuration
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: helloworld-go
namespace: default
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/metric: "concurrency"
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: helloworld-go
namespace: default
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/metric: "rps"
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: helloworld-go
namespace: default
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/metric: "cpu"
Next steps
- Configure concurrency targets for applications
- Configure requests per second targets for replicas of an application
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.