Jaeger
After completing this task, you understand how to have your application participate in tracing with Jaeger, regardless of the language, framework, or platform you use to build your application.
This task uses the Bookinfo sample as the example application.
To learn how Istio handles tracing, visit this task’s overview.
Before you begin
Follow the Jaeger installation documentation to deploy Jaeger into your cluster.
Deploy the Bookinfo sample application.
Configure Istio for distributed tracing
Configure an extension provider
Install Istio with an extension provider referring to the Jaeger collector service:
$ cat <<EOF > ./tracing.yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
meshConfig:
enableTracing: true
defaultConfig:
tracing: {} # disable legacy MeshConfig tracing options
extensionProviders:
- name: jaeger
opentelemetry:
port: 4317
service: jaeger-collector.istio-system.svc.cluster.local
EOF
$ istioctl install -f ./tracing.yaml --skip-confirmation
Enable tracing
Enable tracing by applying the following configuration:
$ kubectl apply -f - <<EOF
apiVersion: telemetry.istio.io/v1
kind: Telemetry
metadata:
name: mesh-default
namespace: istio-system
spec:
tracing:
- providers:
- name: jaeger
EOF
Accessing the dashboard
The Remotely Accessing Telemetry Addons task 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 Jaeger to the istio-system
namespace:
$ istioctl dashboard jaeger
Generating traces using the Bookinfo sample
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 100 requests to the
productpage
service, use the following command:$ for i in $(seq 1 100); do curl -s -o /dev/null "http://$GATEWAY_URL/productpage"; done
From the left-hand pane of the dashboard, select
productpage.default
from the Service drop-down list and click Find Traces:Click on the most recent trace at the top to see the details corresponding to the latest request to the
/productpage
: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
.
Cleanup
Remove any
istioctl
processes that may still be running using control-C or:$ killall istioctl
If you are not planning to explore any follow-on tasks, refer to the Bookinfo cleanup instructions to shutdown the application.