Apache SkyWalking

After completing this task, you will understand how to have your application participate in tracing with Apache SkyWalking, regardless of the language, framework, or platform you use to build it.

This task uses the Bookinfo sample as the example application.

To learn how Istio handles tracing, visit the Distributed Tracing Overview section.

Configure tracing

If you used an IstioOperator CR to install Istio, add the following field to your configuration:

  1. apiVersion: install.istio.io/v1alpha1
  2. kind: IstioOperator
  3. spec:
  4. meshConfig:
  5. defaultProviders:
  6. tracing:
  7. - "skywalking"
  8. enableTracing: true
  9. extensionProviders:
  10. - name: "skywalking"
  11. skywalking:
  12. service: tracing.istio-system.svc.cluster.local
  13. port: 11800

With this configuration, Istio is installed with a SkyWalking Agent as the default tracer. Trace data will be sent to a SkyWalking backend.

In the default profile, the sampling rate is 1%. Increase it to 100% using the Telemetry API:

  1. $ kubectl apply -f - <<EOF
  2. apiVersion: telemetry.istio.io/v1alpha1
  3. kind: Telemetry
  4. metadata:
  5. name: mesh-default
  6. namespace: istio-system
  7. spec:
  8. tracing:
  9. - randomSamplingPercentage: 100.00
  10. EOF

Deploy the SkyWalking Collector

Follow the SkyWalking installation documentation to deploy SkyWalking into your cluster.

Deploy the Bookinfo Application

Deploy the Bookinfo sample application.

Accessing the dashboard

Remotely Accessing Telemetry Addons details how to configure access to the Istio addons through a gateway.

For testing (and temporary access), you may also use port-forwarding. Use the following, assuming you’ve deployed SkyWalking to the istio-system namespace:

  1. $ istioctl dashboard skywalking

Generating traces using the Bookinfo sample

  1. When the Bookinfo application is up and running, access http://$GATEWAY_URL/productpage one or more times to generate trace information.

    To see trace data, you must send requests to your service. The number of requests depends on Istio’s sampling rate and can be configured using the Telemetry API. With the default sampling rate of 1%, you need to send at least 100 requests before the first trace is visible. To send a 100 requests to the productpage service, use the following command:

    1. $ for i in $(seq 1 100); do curl -s -o /dev/null "http://$GATEWAY_URL/productpage"; done
  2. From the “General Service” panel, you can see the service list.

    Service List

    Service List

  3. Select the Trace tab in the main content. You can see the trace list in the left sidebar and the trace details in the right panel:

    Trace View

    Trace View

  4. The trace is comprised of a set of spans, where each span corresponds to a Bookinfo service, invoked during the execution of a /productpage request, or internal Istio component, for example: istio-ingressgateway.

Explore SkyWalking’s official demo application

In this tutorial, we use the Bookinfo sample application, in this sample application there is no SkyWalking agent installed to the services, all the traces are generated by the sidecar proxies.

If you want to explore more about SkyWalking’s language agents, the SkyWalking team also provides a demo application that is integrated with the language agents and you can have more detailed traces as well as other language agent specific features such as profiling.

Cleanup

  1. Remove any istioctl processes that may still be running using control-C or:

    1. $ killall istioctl
  2. If you are not planning to explore any follow-on tasks, refer to the Bookinfo cleanup instructions to shutdown the application.