Istio provides a simple mechanism for collecting metrics for the microservices that we developed without adding any instrumentation to them. In the following example, we will use Mixer's attribute vocabulary to define an instance of Mixer metrics that can be applied to the bookinfo microservices to generate metrics. Then, we'll collect them without having to make any code changes to the application. Let's get started:
- Define the configuration for the metric instance to double the request count:
# Script : 02-create-metric-instance.yaml
apiVersion: config.istio.io/v1alpha2
kind: instance
metadata:
name: doublerequestcount
spec:
compiledTemplate: metric
params:
value: "2" # count each request twice
dimensions:
reporter: conditional((context.reporter.kind | "inbound") == "outbound", "client"...