Telemetry Data Collection, Query, and Visualization with Istio on Alibaba Cloud Container Service for Kubernetes

In our previous articles, we have demonstrated how to deploy an application in the Istio environment with an official example, as well as explored how to configure intelligent routing and distributed tracing with Istio.

This article continues to use this example to explain how to use the Istio functions of collecting, querying, and visualizing the telemetry data.

Prometheus is an open source system released by CNCF. It provides the real-time monitoring, alerting, and time series database (TSDB) functions for the cloud native applications.

Image for post
Image for post

Collect Telemetry Data

First, refer to the metrics and log configurations defined in the official documentation to create a file.

Run the command to create the new configuration, as shown below:

istioctl create -f samples/bookinfo/new_telemetry.yaml
Created config metric/istio-system/doublerequestcount at revision 2611607
Created config prometheus/istio-system/doublehandler at revision 2611608
Created config rule/istio-system/doubleprom at revision 2611609
Created config logentry/istio-system/newlog at revision 2611610
Created config stdio/istio-system/newhandler at revision 2611611
Created config rule/istio-system/newlogstdio at revision 2611612

In the Kubernetes environment, run the following command to check that Prometheus is running properly:

kubectl -n istio-system get svc prometheus
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
prometheus ClusterIP 172.21.9.66 <none> 9090/TCP 16h

Query the Telemetry Data

After confirming that Prometheus is running properly, open the URL of the BookInfo application in the browser: http://{EXTERNAL-IP}/productpage. Alternatively, run the following command for multiple times:

Run the following command to open the Prometheus UI:

kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=prometheus -o jsonpath='{.items[0].metadata.name}') 9090:9090 &

Mixer has a built-in Prometheus adapter and opens a service for collecting the monitoring information.The Prometheus plugin is a Prometheus server that is preconfigured to collect metrics from Mixer.It provides a mechanism for persistent storage and querying of Istio metrics.

The configured Prometheus plugin consists of three parts:

  1. istio-mesh(istio-mixer.istio-system:42422): all Mixer-generated mesh metrics.
  2. mixer(istio-mixer.istio-system:9093): all Mixer-specific metrics.They are used to monitor Mixer itself.
  3. envoy(istio-mixer.istio-system:9102): raw statistics generated by Envoy.
Image for post
Image for post

For more information about querying telemetry data using Prometheus, see the official documentation.

Prometheus comes with the Web console that allows you to conveniently perform PromQL query and debugging. For example:

Image for post
Image for post

As shown in the preceding figure, the Prometheus Web interface is very simple. It facilitates timely data query and PromeQL debugging.

It does not look like a common dashboard, where data is displayed on a page as much as possible. The next section describes who to visualize the data using Grafana.

Visualize the Telemetry Data Using Grafana

In the Kubernetes environment, run the following command to check that Grafana is running properly:

kubectl -n istio-system get svc grafana
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
....

Run the following command to open the Grafana UI:

kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=grafana -o jsonpath='{.items[0].metadata.name}') 3000:3000 &

The Grafana plugin is a preconfigured instance of Grafana. The base image (grafana/grafana:4.1.2) has been modified to start with both a Prometheus data source and the Istio Dashboard installed. In the initial installation of Istio and Mixer, a default global (used for every service) metrics is initialized.The Istio Dashboard is built to be used in conjunction with the default Istio metrics configuration and a Prometheus plugin. The following figures show the different Dashboard pages.

Istio Dashboard:

Image for post
Image for post

Mixer Dashboard:

Image for post
Image for post

Pilot Dashboard:

Image for post
Image for post

Summary

We can use Alibaba Cloud Container Service for Kubernetes to quickly build an Istio open platform for connecting, managing, and securing microservices, and to introduce and configure multiple relevant services for applications.Previous articles in the series use an official example to demonstrate how to deploy an application in the Istio environment and how to configure intelligent routing and distributed tracing. This article continues to use this example to explain how to use the Istio functions of collecting, querying, and visualizing the telemetry dataYou are welcome to use Alibaba Cloud Container Service for Kubernetes to quickly build an Istio open platform and integrate Istio to microservice development in your project.

This article series introduces Istio and its core components, as well as describes how to quickly build an Istio open platform for connecting, managing, and securing microservices on the basis of Alibaba Cloud Container Service for Kubernetes. These articles also use an official example to demonstrate how to deploy an application in the Istio environment; how to configure intelligent routing and distributed tracing; and how to configure Istio functions of collecting, querying, and visualizing the telemetry data.

To review these articles, see:

  1. Using Istio on Alibaba Cloud Container Service for Kubernetes
  2. Go through Istio Features with Samples on Alibaba Cloud Container Service for Kubernetes
  3. Intelligent Routing with Istio on Alibaba Cloud Container Service for Kubernetes
  4. Distributed Tracking with Istio on Alibaba Cloud Container Service for Kubernetes
  5. Telemetry Data Collection, Query, and Visualization with Istio on Alibaba Cloud Container Service for Kubernetes
  6. Fault Diagnosis and Detection using Istio within Alibaba Cloud Container Service for Kubernetes
  7. Observability Analysis using Istio and Kiali within Alibaba Cloud Container Service for Kubernetes

Reference: https://www.alibabacloud.com/blog/telemetry-data-collection%2C-query%2C-and-visualization-with-istio-on-alibaba-cloud-container-service-for-kubernetes_593926?spm=a2c41.11961918.0.0

Written by

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store