Configures a metric aspect.

metrics[]repeated MetricThe set of metrics that will be populated and handed to aspects at run time.


Describes how attributes must be evaluated to produce values for the named metric. Suppose the following MetricDescriptor exists in the global configuration:

  name: "responseCode"
  kind: COUNTER
  value: I64
    name: apiMethod
    valueType: STRING
    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:

  descriptorName: "responseCode" # must match
  value: $requestCount        # Istio expression syntax for the attribute named "requestCount"
    # 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
descriptorNamestringMust match the name of some metricDescriptor in the global config.
valuestringAttribute expression to evaluate to determine the value for this metric; the result of the evaluation must match the value ValueType of the metricDescriptor.
labelsrepeated 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.