Metrics from
The metrics-from annotation is currently in development and may be subject to change.
Metrics from
Use metrics data from another workload.
| Annotation | Default value |
|---|---|
live.stormforge.io/metrics-from |
"" |
Description
The metrics-from annotation configures a workload to use metrics data from another workload when Optimize Live generates recommendations. This is useful when one workload replicates another, or when metrics are centralized in a single workload.
Specify the path to the source workload using the following format:
<cluster>/<namespace>/<resource-type>/<workload>
You can also use templating to reference values from the current workload:
{{ .Cluster }}/{{ .Namespace }}/{{ .Resource }}/{{ .Name }}
For more information about configuring workloads with annotations, see Configure workloads.
Examples
-
Provide a direct path to another workload:
"<cluster>/<namespace>/<resource-type>/<workload>" -
Use templating to reference a related workload in the same namespace, in this example by appending
-primaryto the current workload name:'{{ .Cluster }}/{{ .Namespace }}/{{ .Resource }}/{{ .Name }}-primary' -
Reference a workload in a different cluster and namespace with the same resource and name:
'<cluster>/<namespace>/{{ .Resource }}/{{ .Name }}'