Metric represents a single piece of data to report.
When writing the configuration, the value for the fields associated with this template can either be a literal or an expression. Please note that if the datatype of a field is not istio.mixer.v1.config.descriptor.ValueType, then the expression’s inferred type must match the datatype of the field.
Example config:
apiVersion: "config.istio.io/v1alpha2"
kind: metric
metadata:
name: requestsize
namespace: istio-config-default
spec:
value: request.size | 0
dimensions:
sourceService: source.service | "unknown"
sourceVersion: source.labels["version"] | "unknown"
destinationService: destination.service | "unknown"
destinationVersion: destination.labels["version"] | "unknown"
responseCode: response.code | 200
monitoredResourceType: '"UNSPECIFIED"'
Field | Type | Description |
---|---|---|
value | ValueType | The value being reported. |
dimensions | repeated map<string, ValueType> | The unique identity of the particular metric to report. |
monitoredResourceType | string | Optional. An expression to compute the type of the monitored resource this metric is being reported on. If the metric backend supports monitored resources, these fields are used to populate that resource. Otherwise these fields will be ignored by the adapter. |
monitoredResourceDimensions | repeated map<string, ValueType> | Optional. A set of expressions that will form the dimensions of the monitored resource this metric is being reported on. If the metric backend supports monitored resources, these fields are used to populate that resource. Otherwise these fields will be ignored by the adapter. |