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: instance
stanza 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: handler
stanza of configuration defines a handler nameddoublehandler
. The handlerspec
configures 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 fordoublerequestcount
instances.The
kind: rule
stanza of configuration defines a new rule nameddoubleprom
. The rule directs Mixer to send alldoublerequestcount
instances to thedoublehandler
handler. Because there is nomatch
clause 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.