Integrate Alibaba Cloud Log Service into Istio ruuning on Alibaba Cloud Container Service for Kubernetes

Introduction to OpenTracing

The OpenTracing standard was introduced to prevent API compatibility issues with different distributed tracing systems. OpenTracing is a lightweight standardization layer that is located between applications/class libraries and tracing or log analysis programs. OpenTracing has joined the Cloud Native Computing Foundation (CNCF) and provides uniform concept and data standards for global distributed tracing systems. It provides platform and vendor-neutral APIs, which allow developers to conveniently add (or change) a tracing system.

Alibaba Cloud’s Log Service and Jaeger Distributed Tracing System

Designed to meet the big data needs of the Alibaba Group, Log Service is an all-in-one service for real-time data. It allows you to complete the collection, consumption, transfer, querying, and analysis of large amounts of log data.

Jaeger-client

The Jaeger client implements SDKs that conform to OpenTracing standards for different languages. Applications use the API to write data. The client library transmits trace information to the Jaeger agent according to the sampling policy specified by the application. Data is serialized using Thrift and communicated via UDP.

Jaeger-agent

The Jaeger agent is a network-based daemon that monitors span data received by the UDP port before sending it to the collector in batches. It is designed as a basic component and deployed to all hosts. The agent decouples the client library and collector, shielding the client library from collector routing and discovery details.

Jaeger-collector

The collector receives the data sent by the Jaeger agent and writes the data to backend storage, which is a pluggable component. Jaeger on Aliyun Log Service now features support for Log Service.

Alibaba Cloud’s Log Service

The Jaeger collector persists the received span data to Log Service. The Jaeger query is used to retrieve data from Log Service.

Query&UI

It receives query requests, retrieves traces from backend storage, and displays data via a UI.

Preparing the Kubernetes Environment

Kubernetes 1.10.4 has already been released. You can use the control panel to quickly create a Kubernetes cluster. For more information, refer to Creating a Kubernetes Cluster.

Using an Application Directory to Deploy Istio

Click Application Directory on the left-hand side of the display. Select ack-istio and click Parameters. You can change the parameters to customize the settings (see below):

# tracing(jaeger on AliCloud Log Service)
tracing-on-sls:
enabled: true
storage:
type: aliyun-log
aliyun_sls:
project: newlogsample
logstore: mylogstore1
endpoint: cn-hangzhou.log.aliyuncs.com
accesskey:
id:
secret:
.......
tracing:
enabled: false

Using Istio

Select Container group from the left-hand menu to display container information for the Istio instance that you just created on the right-hand side (see below):

Deploying an Application

Running an application sample with Istio requires no changes to the application itself. Instead, we simply need to configure and run the services in an Istio-enabled environment, with Envoy sidecars injected alongside each service.

Downloading and Installing istioctl

Use the following link to download istioctl. After installation is complete you can find the sample code directory:

Installing the Bookinfo Sample

By default, you need to manually inject a sidecar and run the following commands:

kubectl apply -f <(istioctl kube-inject --debug -f samples/bookinfo/kube/bookinfo.yaml)
istioctl create -f samples/bookinfo/routing/bookinfo-gateway.yaml
kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
details ClusterIP 172.19.2.177 <none> 9080/TCP 15m
productpage ClusterIP 172.19.15.184 <none> 9080/TCP 15m
ratings ClusterIP 172.19.9.228 <none> 9080/TCP 15m
reviews ClusterIP 172.19.11.177 <none> 9080/TCP 15m

Accessing an Application

Run the following command to obtain the ingress gateway details:

kubectl get svc  istio-ingressgateway -n istio-system

Accessing the Jaeger Trace Query Interface from Log Service

Jaeger collects and enables the call chain information from the Istio application. On the container services interface, select Services from the left-hand menu and scroll down to tracing-on-sls-query, as shown below:

Viewing Alibaba Cloud’s Log Service

Log on to the Log Service control panel. Select the target project and click the project name. Click Log consumption model -> View analysis -> Query as shown below):

Summary

This article uses an official example to show how Alibaba Cloud Container Service for Kubernetes can be integrated with Istio and Log Service distributed tracing system. Container Service for Kubernetes enables you to quickly build an Istio platform for managing microservices, easily integrating them into a wide range of microservice projects.

  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

--

--

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
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com