--- title: metrics Config overview: Generated documentation for Mixer's Aspect Configuration Schema order: 1170 layout: docs type: markdown --- ### Index * [MetricsParams](#aspect.config.MetricsParams) (message) * [MetricsParams.Metric](#aspect.config.MetricsParams.Metric) (message) ### MetricsParams Configures a metric aspect.
Field Type Description
metrics[] repeated Metric The set of metrics that will be populated and handed to aspects at run time.
### Metric Describes how attributes must be evaluated to produce values for the named metric. Suppose the following MetricDescriptor exists in the global configuration: ```yaml metricDescriptor: name: "responseCode" kind: COUNTER value: I64 labels: name: apiMethod valueType: STRING labels: name: responseCode valueType: I64 ``` To actually report metrics at run time a mapping from attributes to a metric's labels must be provided in the form of a metric: ```yaml metric: descriptorName: "responseCode" # must match metricDescriptor.name value: $requestCount # Istio expression syntax for the attribute named "requestCount" labels: # either the attribute named 'apiMethod' or the literal string 'unknown'; must eval to a string apiMethod: $apiMethod | "unknown" # either the attribute named 'responseCode' or the literal int64 500; must eval to an int64 responseCode: $responseCode | 500 ```
Field Type Description
descriptorName string Must match the name of some metricDescriptor in the global config.
value string Attribute expression to evaluate to determine the value for this metric; the result of the evaluation must match the value ValueType of the metricDescriptor.
labels repeated map<string, string> Map of metricDescriptor label name to attribute expression. At run time each expression will be evaluated to determine the value provided to the aspect. The result of evaluating the expression must match the ValueType of the label in the metricDescriptor.