I was wondering if anyone could point me to a good source for getting a service using istio to report basic metrics. I would assume that simple things like response successes (200), errors (503,404, etc), transaction time would be automatically wired up but I am guessing I am missing something.
I have used things like collectd and statsd to aggregate metrics in the past but was expecting some basic things to be wired up automatically.
I plan to play with the bookinfo app soon to see if perhaps this answers my questionsL https://istio.io/docs/examples/bookinfo/
If you plan to setup the Bookinfo sample application then I would recommend sticking to istio documentation.
If you go into ISTIO / DOCS / TASKS / TELEMETRY / METRICS / COLLECTING METRICS it will explain how to setup basic metrics collection via the Prometheus UI using Mixer functionality.
The metrics configuration directs Mixer to send metric values to Prometheus. It uses three stanzas (or blocks) of configuration: instance configuration, handler configuration, and rule configuration.
The
kind: instancestanza of configuration defines a schema for generated metric values (or instances) for a new metric nameddoublerequestcount. This instance configuration tells Mixer how to generate metric values for any given request, based on the attributes reported by Envoy (and generated by Mixer itself).The
kind: handlerstanza of configuration defines a handler nameddoublehandler. The handlerspecconfigures how the Prometheus adapter code translates received metric instances into Prometheus-formatted values that can be processed by a Prometheus backend. This configuration specified a new Prometheus metric nameddouble_request_count. The Prometheus adapter prepends theistio_namespace to all metric names, therefore this metric will show up in Prometheus asistio_double_request_count. The metric has three labels matching the dimensions configured fordoublerequestcountinstances.The
kind: rulestanza of configuration defines a new rule nameddoubleprom. The rule directs Mixer to send alldoublerequestcountinstances to thedoublehandlerhandler. Because there is nomatchclause in the rule, and because the rule is in the configured default configuration namespace (istio-system), the rule is executed for all requests in the mesh.
Also you can read and setup Querying Metrics from Prometheus using Prometheus add-on:
Mixer comes with a built-in Prometheus adapter that exposes an endpoint serving generated metric values. The Prometheus add-on is a Prometheus server that comes preconfigured to scrape Mixer endpoints to collect the exposed metrics. It provides a mechanism for persistent storage and querying of Istio metrics.