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.

Prerequisites

Procedure

  1. 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.Deploy Istio
    • 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.Set the endpoint
  2. 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
  3. 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!
  4. 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.
  5. Click the target application to go to the Application Details page. You can see the average response time of the application.

Summary

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.