Tracing Analysis provides developers with various features for distributed application development, including trace mapping, request counting, trace discovery, and application dependency analysis. This topic describes how to enable Tracing Analysis to help developers quickly analyze and diagnose applications on Knative.
- A Kubernetes cluster is created with ACK. For more information, see Create an ACK cluster.
- You can use kubectl to connect to a master node in the cluster. For more information, see Connect to Kubernetes clusters through kubectl.
- Knative is deployed on the Kubernetes cluster. For more information, see Deploy Knative components on a Kubernetes cluster.
- The Serving component is deployed on the Kubernetes cluster. For more information, see Deploy a Knative component.
- Deploy Istio on Kubernetes.
For more information, see Deploy Istio.Notes:
- In Pilot Settings, we recommend that you set Trace Sampling Percentage to a large value to facilitate data sampling. For example, 100.
- Enable Tracing Analysis. Set View Token to On and use zipkin to gather data. Currently, only the /api/v1/spans endpoint is supported. You also need to select the endpoint in the region where the cluster is located. We recommend that you select an internal endpoint. The following figure uses the China (Shenzhen) region as an example.
- Select Activate Tracing Analysis and enter the endpoint from the previous step.
- Run the following command to enable automatic sidecar injection as follows:
istio-injection=enabled.This injects the envoy proxy as a sidecar, which intercepts traffic and automatically sends reports to the tracing system. The following example uses the default namespace:
kubectl label namespace default istio-injection=enabled
- Deploy a Knative service.
For more information, see Use Knative to deploy a Hello World application.Run the following command to access the Hello World service.
$ curl -H "Host: helloworld-go.default.example.com" http://112.124.XX.XX Hello Knative!
- Log on to the Tracing Analysis console and click Applications in the left-side navigation pane. Find the target application and view its tracing information.
- Click the target application to go to the Application Details page. You can see the average response time of the application.
We recommend that you enable Tracing Analysis on Knative. The service makes it easy to troubleshoot issues among applications and improves the efficiency of problem solving.