Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Trace a slow request with Istio and OpenTelemetry

By updated

Improve this page

To find the service that slows a request down, you make each hop of the mesh emit a span, send the spans to an OpenTelemetry collector, then read the complete trace in Jaeger. This lesson does it on Istio 1.32.0 in ambient mode, with a chain of three components, client, web and api, the last of which waits between 1000 and 1500 ms before answering. A trace is the journey of a request, and a span is one step of that journey with its duration. The lesson is aimed at readers who already know how to install Istio and want to diagnose latency, on the CKNE theme "Troubleshooting End-to-End Network Performance with Tracing".

What you will learn

  • Say who produces the spans in ambient mode, and why you need a waypoint to get any.
  • Declare an OpenTelemetry provider in meshConfig.extensionProviders, then enable it with a Telemetry resource.
  • Deploy a waypoint and wait until it is really ready before sending traffic.
  • Query Jaeger 2.23.0 through its v3 API.
  • Find out why no span reaches the collector although the waypoint sees the traffic.
  • Make the slow hop appear in a single trace, and say why the mesh does not do it in place of the application.
  • Enable the waypoint's access log, read its two lines for one request, and say why the ztunnel duration is not a request latency.

Prerequisites

  • The lesson Gateway API over HTTPS, which installs Istio 1.32.0 in ambient mode with istioctl install -y -f /root/istio-ambient.yaml. That file is the starting point of this lesson, and its installation is not repeated.
  • The section Ambient mode, without sidecars, to know what ztunnel and ambient mode are.
  • A three-node kubeadm cluster with Istio 1.32.0 in ambient mode, kubectl, istioctl and jq on the control node, and cluster administrator rights. The /root/istio-ambient.yaml file from the previous lesson must still be there: the section on the OpenTelemetry provider copies it and adds a block to it.

To go deeper on traces, spans and sampling, the lesson Traces (in French) of the Observability training covers them in detail. You do not need it to follow this one: the trace and the span are defined in the introduction, and traceparent, the only other notion you need, further down.

Which versions does the demonstration use?

The demonstration runs on a three-node kubeadm cluster. The following command gives the Kubernetes version and the Istio versions.

Terminal window
kubectl version | grep Server; istioctl version
Server Version: v1.37.2
client version: 1.32.0
control plane version: 1.32.0
data plane version: 1.32.0 (3 proxies)

The collector is the otel/opentelemetry-collector-contrib image in 0.165.0, Jaeger is 2.23.0 and the services of the chain are podinfo 6.17.0. The behaviors described hold for this combination of versions. The point about Jaeger's API, in particular, depends on the version.

Who produces spans in ambient mode?

In ambient mode, no proxy is added to the Pods. The ztunnel, an agent installed on each node, carries the traffic at the TCP level (layer 4): it encrypts and routes connections, but it does not read HTTP. It therefore cannot describe an HTTP request with a span.

To get spans per request, you need a waypoint, an Envoy proxy that you deploy for a namespace and that understands HTTP (layer 7). It creates a span for each request it relays, then sends it to a collector, the service that receives spans and that the lesson sets up below. The following diagram shows the path of the lesson's chain: follow the numbered arrows of the request, then the thick arrows of the spans.

Path of a request and its spans. The client Pod sends its request to the waypoint, which forwards it to the web Pod. The web Pod calls the api Pod, and that call also goes through the waypoint. The waypoint, an L7 proxy, creates one span per request and exports them over OTLP to the OpenTelemetry collector, port 4317 over gRPC. The collector sends them to Jaeger, which stores the traces.1 · request2 · to web3 · call to api4 · to apiOTLP spans​     client Pod​     waypoint​     L7 proxy​     one span per requestweb Podapi Pod1000 to 1500 msdelayOpenTelemetryCollectorport 4317 over gRPC​     Jaeger​     stores the traces
Source · SVG
Esc to close, + and − to zoom, scroll to move around. 100 %

The waypoint sees both hops, client to web then web to api. It does not know, however, that the second call follows from the first: that information has to come from the application, and the trace read further down shows it.

That information travels in the traceparent HTTP header. It carries the trace identifier and the parent span's identifier: a span that receives a traceparent joins the indicated trace, and a request that carries none opens a new trace.

How do you deploy the collector and Jaeger?

The OpenTelemetry collector is a service that receives spans, batches them and forwards them to a storage backend. Here the backend is Jaeger (in French), which keeps the traces and lets you read them. Both live in an observabilite namespace, outside the mesh.

OTLP (OpenTelemetry Protocol) is the standard protocol for sending spans, on top of gRPC or HTTP. Here is the collector configuration: an OTLP receiver over gRPC (port 4317) and HTTP (port 4318), batch processing, and two exporters, one to Jaeger, the other to the collector's own log.

The exporter to Jaeger is called otlp_grpc/jaeger. The name otlp/jaeger still works on version 0.165.0, but the collector flags it as deprecated at startup.

apiVersion: v1
kind: ConfigMap
metadata:
name: otel-collector
namespace: observabilite
data:
config.yaml: |
receivers:
otlp:
protocols:
grpc: {endpoint: 0.0.0.0:4317}
http: {endpoint: 0.0.0.0:4318}
processors:
batch: {}
exporters:
otlp_grpc/jaeger:
endpoint: jaeger.observabilite:4317
tls: {insecure: true}
debug: {verbosity: basic}
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlp_grpc/jaeger, debug]

Look at the Service that exposes the collector: the gRPC port is named otlp-grpc and nothing else. This form causes the problem further down, and you keep it as is to watch it fail.

apiVersion: v1
kind: Service
metadata:
name: otel-collector
namespace: observabilite
spec:
selector:
app: otel-collector
ports:
- name: otlp-grpc
port: 4317
- name: otlp-http
port: 4318

The two Deployments and Jaeger's Service remain, in the same file. The collector mounts the ConfigMap in /conf and runs --config=/conf/config.yaml. Jaeger exposes ports 4317 (OTLP reception) and 16686 (interface and API). Both images are pinned by their digest. Combine the three blocks of this section into an observabilite.yaml file, separated by ---. Create the namespace with kubectl create namespace observabilite, then apply the file with kubectl apply -f observabilite.yaml.

apiVersion: apps/v1
kind: Deployment
metadata:
name: otel-collector
namespace: observabilite
spec:
selector:
matchLabels:
app: otel-collector
template:
metadata:
labels:
app: otel-collector
spec:
containers:
- name: c
image: otel/opentelemetry-collector-contrib:0.165.0@sha256:e40d61f10c9a617cca1ffd1be4d7e2b3a4b0f0001798ff07e58cabe82e618cea
args: ["--config=/conf/config.yaml"]
volumeMounts:
- name: conf
mountPath: /conf
volumes:
- name: conf
configMap:
name: otel-collector
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jaeger
namespace: observabilite
spec:
selector:
matchLabels:
app: jaeger
template:
metadata:
labels:
app: jaeger
spec:
containers:
- name: jaeger
image: jaegertracing/jaeger:2.23.0@sha256:3823829974ccfc2485d2e48b165579091f32295022ae80ca49704e2f4834116e
ports:
- containerPort: 4317
- containerPort: 16686
---
apiVersion: v1
kind: Service
metadata:
name: jaeger
namespace: observabilite
spec:
selector:
app: jaeger
ports:
- name: otlp-grpc
port: 4317
- name: ui
port: 16686

Once the manifests are applied, wait for the two Deployments, then read the collector's log.

Terminal window
kubectl -n observabilite rollout status deploy/jaeger --timeout=180s && kubectl -n observabilite rollout status deploy/otel-collector --timeout=180s
kubectl -n observabilite logs deploy/otel-collector
deployment "jaeger" successfully rolled out
deployment "otel-collector" successfully rolled out
2026-11-17T19:31:44.525Z info otelconftelemetry/tracer.go:47 Internal trace telemetry disabled {"resource": {"service.instance.id": "2a0dbb65-b3fa-4b5c-886f-13804ee8b49b", "service.name": "otelcol-contrib", "service.version": "0.165.0"}}
2026-11-17T19:31:44.526Z info service@v0.165.0/service.go:233 Starting otelcol-contrib... {"resource": {"service.instance.id": "2a0dbb65-b3fa-4b5c-886f-13804ee8b49b", "service.name": "otelcol-contrib", "service.version": "0.165.0"}, "Version": "0.165.0", "NumCPU": 2}
2026-11-17T19:31:44.526Z info extensions/extensions.go:43 Starting extensions... {"resource": {"service.instance.id": "2a0dbb65-b3fa-4b5c-886f-13804ee8b49b", "service.name": "otelcol-contrib", "service.version": "0.165.0"}}
2026-11-17T19:31:44.527Z info otlpreceiver@v0.165.0/otlp.go:142 Starting GRPC server {"resource": {"service.instance.id": "2a0dbb65-b3fa-4b5c-886f-13804ee8b49b", "service.name": "otelcol-contrib", "service.version": "0.165.0"}, "otelcol.component.id": "otlp", "otelcol.component.kind": "receiver", "endpoint": "[::]:4317"}
2026-11-17T19:31:44.527Z info otlpreceiver@v0.165.0/otlp.go:197 Starting HTTP server {"resource": {"service.instance.id": "2a0dbb65-b3fa-4b5c-886f-13804ee8b49b", "service.name": "otelcol-contrib", "service.version": "0.165.0"}, "otelcol.component.id": "otlp", "otelcol.component.kind": "receiver", "endpoint": "[::]:4318"}
2026-11-17T19:31:44.527Z info service@v0.165.0/service.go:256 Everything is ready. Begin running and processing data. {"resource": {"service.instance.id": "2a0dbb65-b3fa-4b5c-886f-13804ee8b49b", "service.name": "otelcol-contrib", "service.version": "0.165.0"}}

Look at the last line, Everything is ready. Begin running and processing data.: the collector has loaded its configuration and is waiting for spans. The log contains no warning line, which confirms that the name otlp_grpc is the right one. The first two lines of rollout status keep only their conclusion, the waiting messages are removed.

How do you declare the OpenTelemetry provider in Istio?

Istio does not know the collector until you declare it. A provider (extension provider) gives a name to a service that receives traces: you write it in meshConfig.extensionProviders, then reuse it by that name. Copy the IstioOperator file from the previous lesson (cp /root/istio-ambient.yaml /root/istio-ambient-otel.yaml) and add this block under spec, at the same level as profile.

meshConfig:
extensionProviders:
- name: otel-tracing
opentelemetry:
service: otel-collector.observabilite.svc.cluster.local
port: 4317

Reapply the complete file (ambient profile and meshConfig) with istioctl install. The components are reconfigured, without a reinstall from scratch.

Terminal window
istioctl install -y -f /root/istio-ambient-otel.yaml 2>&1 | tail -6
kubectl -n istio-system get configmap istio -o jsonpath='{.data.mesh}' | grep -A4 extensionProviders
- Processing resources for Istiod, Ztunnel.
✔ Ztunnel installed 🔒
- Processing resources for Istiod.
✔ Istiod installed 🧠
- Pruning removed resources
✔ Installation completeThe ambient profile has been installed successfully, enjoy Istio without sidecars!
extensionProviders:
- name: otel-tracing
opentelemetry:
port: 4317
service: otel-collector.observabilite.svc.cluster.local

The second command reads the istio ConfigMap of the istio-system namespace, where istiod keeps the mesh configuration. Check that the otel-tracing provider appears there with the right service and port: if it is missing, the next resource will point to a name nobody knows.

How do you enable tracing with a Telemetry resource?

Declaring a provider traces nothing. The Telemetry resource says which provider to use and for what share of requests. This one is placed in istio-system, so it applies to the whole mesh.

apiVersion: telemetry.istio.io/v1
kind: Telemetry
metadata:
name: mesh-default
namespace: istio-system
spec:
tracing:
- providers:
- name: otel-tracing
randomSamplingPercentage: 100

Save this manifest as telemetry-mesh.yaml, then apply it with kubectl apply -f telemetry-mesh.yaml.

randomSamplingPercentage: 100 traces every request: it is the right setting for a diagnosis, since you want to find the slow request.

In production, tracing 100% of requests produces a volume of spans that weighs on the proxies, the network and the storage: you then sample a fraction of the requests, and the choice is discussed with the team that pays for the storage. With a lower rate, a request the draw did not select produces no span at all, whatever its duration: the slow request you are looking for may then be missing from Jaeger. The lesson Traces (in French) compares head-based and tail-based sampling.

How do you deploy the client, web and api chain?

The chain runs in a boutique namespace, which the label istio.io/dataplane-mode: ambient brings into the mesh. api is a podinfo with a random delay of 1000 to 1500 ms. web is a podinfo that calls api again when it receives a request on /echo. client is a curl Pod that waits. The boutique.yaml file combines the next block and the one after it.

apiVersion: v1
kind: Namespace
metadata:
name: boutique
labels:
istio.io/dataplane-mode: ambient
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api
namespace: boutique
spec:
selector:
matchLabels:
app: api
template:
metadata:
labels:
app: api
spec:
containers:
- name: podinfo
image: ghcr.io/stefanprodan/podinfo:6.17.0@sha256:fa2f27c1a8561097e5144bfc0853eba6054d743b68b03de4cad4675616ddefb0
command: [./podinfo, --port=9898, --random-delay=true, --random-delay-unit=ms, --random-delay-min=1000, --random-delay-max=1500]
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
namespace: boutique
spec:
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: podinfo
image: ghcr.io/stefanprodan/podinfo:6.17.0@sha256:fa2f27c1a8561097e5144bfc0853eba6054d743b68b03de4cad4675616ddefb0
command: [./podinfo, --port=9898, --backend-url=http://api.boutique:9898/echo]

The two Services and the client Pod complete the file: one Service per application, with a port named http on 9898, and a curl Pod that waits. Separate the two blocks with ---, then apply the file with kubectl apply -f boutique.yaml.

apiVersion: v1
kind: Service
metadata:
name: api
namespace: boutique
spec:
selector:
app: api
ports:
- name: http
port: 9898
---
apiVersion: v1
kind: Service
metadata:
name: web
namespace: boutique
spec:
selector:
app: web
ports:
- name: http
port: 9898
---
apiVersion: v1
kind: Pod
metadata:
name: client
namespace: boutique
spec:
containers:
- name: c
image: curlimages/curl:8.17.0@sha256:935d9100e9ba842cdb060de42472c7ca90cfe9a7c96e4dacb55e79e560b3ff40
command: ["sleep", "36000"]

Before any waypoint, send five requests from the client and read the HTTP code and the duration of each.

Terminal window
for i in $(seq 1 5); do kubectl -n boutique exec client -- curl -s -o /dev/null -w '%{http_code} %{time_total}s\n' -X POST -d bonjour http://web.boutique:9898/echo; done
200 1.450438s
200 1.307898s
200 1.049789s
200 1.104261s
200 1.230088s

All five requests succeed and last between 1.05 and 1.45 s. Here is the problem: the client sees the slowness, but it does not know whether it comes from web or from api. In the collector's log, no Traces line appears for these requests: the ztunnel produced no span.

Why deploy a waypoint, and how do you wait for it?

The waypoint is installed for the whole namespace with istioctl waypoint apply. The --enroll-namespace option adds the label istio.io/use-waypoint: waypoint to the namespace, which diverts the traffic of the boutique Services to it.

Terminal window
istioctl waypoint apply -n boutique --enroll-namespace --wait
kubectl -n boutique get pods -o wide
✅ waypoint boutique/waypoint applied
✅ waypoint boutique/waypoint is ready!
✅ namespace boutique labeled with "istio.io/use-waypoint: waypoint"
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
api-79df885dc5-cl285 1/1 Running 0 38s 10.244.38.66 k8s-w1.lab <none> <none>
client 1/1 Running 0 38s 10.244.38.99 k8s-w1.lab <none> <none>
waypoint-c9749c48f-q9rs6 0/1 Running 0 2s 10.244.38.121 k8s-w1.lab <none> <none>
web-7458c57ff4-jdmgt 1/1 Running 0 38s 10.244.223.9 k8s-w2.lab <none> <none>

Look at the line waypoint boutique/waypoint is ready!, then at the READY column of the waypoint-… Pod: it shows 0/1. --wait announces that the waypoint is ready while its Pod is not ready yet. The command waits for the waypoint's Gateway resource to be programmed, not for its Pod to be ready. The traffic is already diverted to it, and requests sent at that moment fail.

000 0.000567s
command terminated with exit code 56
000 0.000580s
command terminated with exit code 52
000 0.000630s
command terminated with exit code 56

These three lines are the first of ten requests sent right after the command. All ten failed: the HTTP code is 000 because curl received no response, it exits with code 56 or 52, and each attempt lasts less than a millisecond. The remedy is to wait for the Pod itself before sending traffic.

Terminal window
kubectl -n boutique wait --for=condition=Ready pod -l gateway.networking.k8s.io/gateway-name=waypoint --timeout=120s
istioctl ztunnel-config services | grep -E 'NAMESPACE|boutique'
pod/waypoint-c9749c48f-q9rs6 condition met
NAMESPACE SERVICE NAME SERVICE VIP WAYPOINT ENDPOINTS
boutique api 10.103.61.38 waypoint 1/1
boutique waypoint 10.107.39.239 None 1/1
boutique web 10.104.210.177 waypoint 1/1

condition met says the Pod is ready. In the second output, the api and web Services carry waypoint in the WAYPOINT column: their traffic does go through it. The ten requests sent afterwards succeed, all with 200, between 1.17 and 1.48 s.

How do you read traces in Jaeger 2.23?

Jaeger documents its v3 API as the stable API, and describes the /api/* paths as an internal, undocumented API subject to change. On Jaeger 2.23.0, /api/services returns 404 page not found, whereas /api/v3/services returns the list.

Terminal window
kubectl -n observabilite run lecteur --rm -i --restart=Never --quiet --image=curlimages/curl:8.17.0@sha256:935d9100e9ba842cdb060de42472c7ca90cfe9a7c96e4dacb55e79e560b3ff40 -- -s http://jaeger.observabilite:16686/api/v3/services
{"services":["jaeger"]}

This output shows the starting problem: the list contains only jaeger. The ten requests went through the waypoint and no span arrived.

The lecteur Pod runs curl from inside the cluster, because Jaeger is not exposed. To read traces from the control node, start a port-forward, which makes Jaeger's port 16686 available locally, and jq filters the response. Traces are requested with /api/v3/traces?query.serviceName=<service>, with the bounds query.startTimeMin and query.startTimeMax (dates in RFC 3339 format, in UTC) and query.searchDepth for the maximum number of traces. The response is in OTLP JSON format.

The two curl commands of the lesson carry a start date and an end date. Replace them with your own dates, which you take with date -u +%Y-%m-%dT%H:%M:%SZ before and after sending your requests.

Write the parameters with the v3 API names, as above: Jaeger 2.23.0 still accepts old names with underscores, but they are deprecated.

The port-forward runs in the background. The same port serves Jaeger's web interface and the API: curl -s localhost:16686/ returns the interface's HTML page.

Terminal window
kubectl -n observabilite port-forward svc/jaeger 16686:16686 > /tmp/pf.log 2>&1 &
curl -s localhost:16686/ | head -3
<!doctype html>
<html lang="en">
<head>

Three lines of HTML are enough to show that the interface answers on the same port. The following sections reuse this port-forward to read the traces. It stays active until you stop it, which the cleanup at the end of the lesson does.

Why does no span arrive although the waypoint sees the traffic?

You first need to know whether the waypoint sees the requests. Its metrics tell you: istio_requests_total counts every relayed request.

Terminal window
kubectl -n boutique exec deploy/waypoint -- pilot-agent request GET stats/prometheus | grep '^istio_requests_total'
istio_requests_total{reporter="waypoint",source_workload="client",source_canonical_service="client",source_canonical_revision="latest",source_workload_namespace="boutique",destination_workload="web",destination_workload_namespace="boutique",destination_service="web.boutique.svc.cluster.local",destination_canonical_service="web",destination_canonical_revision="latest",destination_service_name="web",destination_service_namespace="boutique",response_code="200"} 10
istio_requests_total{reporter="waypoint",source_workload="web",source_canonical_service="web",source_canonical_revision="latest",source_workload_namespace="boutique",destination_workload="api",destination_workload_namespace="boutique",destination_service="api.boutique.svc.cluster.local",destination_canonical_service="api",destination_canonical_revision="latest",destination_service_name="api",destination_service_namespace="boutique",response_code="202"} 10

Look at the end of each line: 10 requests from client to web with 200, and 10 from web to api with 202. The waypoint sees everything: the problem lies between it and the collector. The collector's log, for its part, stays silent, which does not help.

The failure can only be read in the waypoint's log, provided you raise its level of detail. The first command sets the tracing, grpc and http2 loggers to debug. Then send three requests with the earlier loop, and run the second command, which looks for export errors.

Terminal window
istioctl proxy-config log deploy/waypoint -n boutique --level tracing:debug,grpc:debug,http2:debug | grep -E 'tracing|grpc|http2'
kubectl -n boutique logs deploy/waypoint --since=40s | grep -iE 'trac|grpc|otel|4317|export|error|fail|reset' | head -30
grpc: debug
http2: debug
tracing: debug
2026-11-17T18:50:11.723298Z debug envoy tracing external/envoy+/source/extensions/tracers/opentelemetry/trace_exporter.h:46 Number of exported spans: 2 thread=21
2026-11-17T18:50:11.724179Z debug envoy tracing external/envoy+/source/extensions/tracers/opentelemetry/grpc_trace_exporter.cc:39 OTLP trace export failed with status: Unavailable, message: upstream connect error or disconnect/reset before headers. reset reason: protocol error{upstream_reset_before_response_started{protocol_error}} thread=21

The output is shortened to two of the eight lines. Look at the second one: OTLP trace export failed with status: Unavailable … protocol error. The waypoint does create its spans (Number of exported spans: 2), but every export fails.

The cause lies in the port name. Istio picks a port's protocol from its appProtocol field or, failing that, from a name that is grpc or starts with grpc-. A port named otlp-grpc, without appProtocol, is not recognized as gRPC: the waypoint does not force HTTP/2 toward the collector, and every export fails with protocol error. Check it in the configuration of the collector's "cluster", seen from the waypoint, then fix the Service. An Envoy cluster is a destination in the proxy's configuration, unrelated to a Kubernetes cluster.

Terminal window
kubectl -n observabilite patch svc otel-collector --type=json -p '[{"op":"add","path":"/spec/ports/0/appProtocol","value":"grpc"}]'
istioctl proxy-config cluster deploy/waypoint -n boutique --fqdn otel-collector.observabilite.svc.cluster.local --port 4317 -o json | grep -A3 -E 'useDownstreamProtocolConfig|explicitHttpConfig'
service/otel-collector patched
"explicitHttpConfig": {
"http2ProtocolOptions": {}
}
}

Before the fix, this cluster was configured with useDownstreamProtocolConfig, which reuses the protocol of the original connection. Afterwards, it carries explicitHttpConfig and http2ProtocolOptions: the waypoint speaks HTTP/2 to the collector, as gRPC requires. Five requests later, the waypoint's log no longer reports a failure and the collector receives the spans.

2026-11-17T18:50:41.727334Z debug envoy tracing external/envoy+/source/extensions/tracers/opentelemetry/trace_exporter.h:46 Number of exported spans: 4 thread=21
2026-11-17T18:50:41.747Z info Traces {"resource": {"service.instance.id": "a0875e9f-df3b-4c6f-8448-892feed76d96", "service.name": "otelcol-contrib", "service.version": "0.165.0"}, "otelcol.component.id": "debug", "otelcol.component.kind": "exporter", "otelcol.signal": "traces", "resource spans": 2, "spans": 8}

The first line comes from the waypoint's log, the second from the collector's: it contains "spans": 8, so spans did arrive. Jaeger's v3 API lists them too.

{"services":["jaeger","waypoint.boutique"]}

The waypoint.boutique service has appeared. Then put the waypoint's loggers back to their normal level, because debug is chatty.

Terminal window
istioctl proxy-config log deploy/waypoint -n boutique --level tracing:warning,grpc:warning,http2:warning > /dev/null

Why does each hop form a separate trace?

Each hop forms its own trace: for ten requests, Jaeger returns twenty traces of a single span. The reading below assumes that web runs without the --otel-service-name option, which is its state at this point of the lesson. Without that option, web emits no span and only the waypoint produces any: the request therefore targets query.serviceName=waypoint.boutique.

Start by putting web back in that state. The command replaces its launch line with the version without the option: it changes nothing if web already runs that way, and it removes the option if you have already enabled propagation (next section, which puts it back). The OTEL_* variables can stay in place without changing this result.

Terminal window
kubectl -n boutique patch deploy web --type=json -p '[{"op":"replace","path":"/spec/template/spec/containers/0/command","value":["./podinfo","--port=9898","--backend-url=http://api.boutique:9898/echo"]}]'
kubectl -n boutique rollout status deploy/web --timeout=120s

Then take the time with date -u +%Y-%m-%dT%H:%M:%SZ, send ten requests from the client with the loop used above (seq 1 10), then take the time again: these two dates are the bounds of the next request.

Terminal window
for i in $(seq 1 10); do kubectl -n boutique exec client -- curl -s -o /dev/null -w '%{http_code} %{time_total}s\n' -X POST -d bonjour http://web.boutique:9898/echo; done

The curl then queries the v3 API over a window of a few seconds around your ten requests (replace the bounds with yours), and jq groups the spans by trace before printing one line per trace, in start order.

Terminal window
curl -s "http://localhost:16686/api/v3/traces?query.serviceName=waypoint.boutique&query.startTimeMin=2026-11-17T19:39:26Z&query.startTimeMax=2026-11-17T19:39:55Z&query.searchDepth=20" | jq -r '[.result.resourceSpans[]
| (.resource.attributes[] | select(.key == "service.name") | .value.stringValue) as $svc
| .scopeSpans[].spans[]
| {trace: .traceId, svc: $svc, span: .name,
debut: (.startTimeUnixNano | tonumber),
ms: (((.endTimeUnixNano | tonumber) - (.startTimeUnixNano | tonumber)) / 1000000)}]
| group_by(.trace) | sort_by(.[0].debut) | .[]
| "\(.[0].trace[0:8]) \(length) span(s) \(map(.svc) | unique | join(",")) \(map(.ms) | max | floor) ms \(map(.span) | unique | join(" + "))"'
fa9b3fa2 1 span(s) waypoint.boutique 1401 ms web.boutique.svc.cluster.local:9898/*
90a69d65 1 span(s) waypoint.boutique 1392 ms api.boutique.svc.cluster.local:9898/*
055c1c54 1 span(s) waypoint.boutique 1208 ms web.boutique.svc.cluster.local:9898/*
efe87af5 1 span(s) waypoint.boutique 1205 ms api.boutique.svc.cluster.local:9898/*
…

The output is cut after four lines (…): all twenty traces have a single span, and the web and api hops alternate. A client request crosses two hops, so you expected a trace of two spans, and you find twenty traces of one span, ten for web and ten for api. The waypoint adds the traceparent header to the request it hands to web, but podinfo does not copy it into the call it then makes to api. The waypoint therefore receives a second call without context and opens a new trace.

The durations are close two by two, 1401 and 1392 ms, then 1208 and 1205 ms, but the trace identifiers differ on every line. You suspect api, but nothing confirms it: the span toward web may or may not contain api's time, and nothing links the two traces.

The number 20 is the query.searchDepth=20 limit. Here the count is complete, since ten requests make two hops each. With a wider window, Jaeger would cut the list at 20 traces without any message: take a searchDepth higher than the number of traces you expect.

The mesh does not propagate the context in place of the application. A waypoint knows how to read and write traceparent on the requests that cross it. It does not know that an outgoing request from web is the consequence of an incoming one: only the application, which holds both in the same code, can copy the header.

How do you make the slow hop appear in a single trace?

web has to copy traceparent into its call to api. The diagram puts the two cases side by side: on the left, web copies nothing and the waypoint opens a second trace for the call to api; on the right, web copies the header and the waypoint's two spans join the same trace. The red boxes show the cause, web not copying the header, and the last box the effect, a second trace.

Two runs of the same request, side by side. Without copying: the waypoint creates a span toward web in trace A, web calls api without traceparent, and the waypoint opens a new trace B for the call to api. With copying: the waypoint creates the same first span in trace A, web calls api and copies traceparent, and the waypoint's span toward api stays in trace A.Waypointspan to webtrace Aweb calls apiwithout traceparentWaypointspan to apitrace B, a new oneWithout copying:two separate tracesWaypointspan to webtrace Aweb calls apiand copies traceparentWaypointspan to apitrace AWith copying:a single trace
Source · SVG
Esc to close, + and − to zoom, scroll to move around. 100 %

podinfo copies the header when you enable its OpenTelemetry tracing with --otel-service-name, and tell it where the collector is through two environment variables.

Terminal window
kubectl -n boutique patch deploy web --type=json -p '[{"op":"replace","path":"/spec/template/spec/containers/0/command","value":["./podinfo","--port=9898","--backend-url=http://api.boutique:9898/echo","--otel-service-name=web"]},{"op":"add","path":"/spec/template/spec/containers/0/env","value":[{"name":"OTEL_EXPORTER_OTLP_ENDPOINT","value":"http://otel-collector.observabilite:4317"},{"name":"OTEL_EXPORTER_OTLP_INSECURE","value":"true"}]}]'
kubectl -n boutique rollout status deploy/web --timeout=120s
deployment.apps/web patched
Waiting for deployment "web" rollout to finish: 1 old replicas are pending termination...
Waiting for deployment "web" rollout to finish: 1 old replicas are pending termination...
deployment "web" successfully rolled out

The web service now sends its own spans to the collector, in addition to the waypoint's, and it forwards the context. Send ten requests with the same loop: Jaeger's service list then contains a third name, web.

{"services":["jaeger","waypoint.boutique","web"]}

Each request now gives a single trace, which groups the waypoint's spans and those of web. The following command reads it: it queries the v3 API on the web service for a five-minute window (replace the bounds with yours), then jq groups the spans by trace, keeps the first group and sorts it by descending duration.

Terminal window
curl -s "http://localhost:16686/api/v3/traces?query.serviceName=web&query.startTimeMin=2026-11-17T19:27:08Z&query.startTimeMax=2026-11-17T19:32:08Z&query.searchDepth=20" | jq -r '[.result.resourceSpans[]
| (.resource.attributes[] | select(.key == "service.name") | .value.stringValue) as $svc
| .scopeSpans[].spans[]
| {trace: .traceId, svc: $svc, span: .name,
ms: (((.endTimeUnixNano | tonumber) - (.startTimeUnixNano | tonumber)) / 1000000)}]
| group_by(.trace) | .[0] | sort_by(-.ms) | .[]
| "\(.ms | floor) ms\t\(.svc)\t\(.span)"'
1394 ms waypoint.boutique web.boutique.svc.cluster.local:9898/*
1392 ms web POST /echo
1392 ms web echoHandler
1391 ms web HTTP POST
1386 ms waypoint.boutique api.boutique.svc.cluster.local:9898/*
0 ms web http.getconn
0 ms web http.dns
0 ms web http.receive
0 ms web http.connect
0 ms web http.send
0 ms web http.headers

Read the lines from top to bottom, looking for where the time is. The request lasts 1394 ms seen from the waypoint, and the HTTP POST span of web, the call to api, takes 1391: everything else in web fits under 1 ms. The waypoint's span toward api lasts 1386 ms, almost as much. The slow hop is therefore api, and it is no longer a guess: web spends all its time waiting for it. api sends no span, it is not instrumented, and its time is read in the span that the waypoint opens to reach it.

Sorting by duration rather than by start avoids a trap: sorted by start, the result may show the waypoint's span toward api before the web spans that call it, because the clocks of two nodes are never perfectly synchronized.

The filter has a limit. group_by(.trace) | .[0] takes the trace whose identifier is the smallest in the window, not the most recent. If the window covers several requests, you read a random trace: narrow it around the request you are looking for, or send a single request before reading. The first trace is only an example, and the others are read the same way: you look for the span that takes up almost the whole duration of its parent.

How do you confirm the slow hop with the access log?

The waypoint's access log confirms the trace without any tracing tool: it writes one line per relayed request, with its duration. It writes nothing until a Telemetry resource enables it. Before creating one, the following command counts the waypoint's POST lines over the last 30 minutes. The lesson Enforce timeouts, retries and authorizations between services (in French) enables the same log with the same resource, but on Pods with a sidecar.

Terminal window
kubectl -n boutique logs deploy/waypoint --since=30m | grep -c '"POST '
0

The waypoint has relayed POST requests, yet it has logged none. The following resource, placed in the boutique namespace, enables the log for the waypoint. It targets it through targetRefs, which designates the waypoint's Gateway. In ambient mode, a selector does not target a waypoint. The envoy provider writes the lines to the waypoint's standard output.

apiVersion: telemetry.istio.io/v1
kind: Telemetry
metadata:
name: journal-acces-waypoint
namespace: boutique
spec:
targetRefs:
- kind: Gateway
group: gateway.networking.k8s.io
name: waypoint
accessLogging:
- providers:
- name: envoy

Save this manifest as journal-waypoint.yaml, then apply it:

Terminal window
kubectl apply -f journal-waypoint.yaml
telemetry.telemetry.istio.io/journal-acces-waypoint created

After three requests from client to web, the waypoint's log contains six POST lines, two per request. Here are the two of the first request, whose trailing fields have been cut (…).

Terminal window
kubectl -n boutique logs deploy/waypoint --since-time=2026-11-17T19:02:46Z | grep '"POST '
[2026-11-17T19:02:46.519Z] "POST /echo HTTP/1.1" 202 - via_upstream - "-" 7 7 1184 1184 "-" "Go-http-client/1.1" "3e277151-9ec7-9f58-bfcd-ca8555fd2376" "api.boutique:9898" "envoy://connect_originate/10.244.38.66:9898" inbound-vip|9898|http|api.boutique.svc.cluster.local …
[2026-11-17T19:02:46.512Z] "POST /echo HTTP/1.1" 200 - via_upstream - "-" 7 15 1192 1192 "-" "curl/8.17.0" "3e277151-9ec7-9f58-bfcd-ca8555fd2376" "web.boutique:9898" "envoy://connect_originate/10.244.223.28:9898" inbound-vip|9898|http|web.boutique.svc.cluster.local …

Each line describes a hop. The first is the call from web to api (code 202, client Go-http-client), the second the call from client to web (code 200, client curl). Look first at the quoted field that follows the client: 3e277151-9ec7-9f58-bfcd-ca8555fd2376 is the same on both lines. It is the x-request-id header, which links the two lines without going through Jaeger.

It is not the mesh that carries it from web to api, it is the application. To check, send an identifier of your choice with -H and look for it in the waypoint's log. The test is conclusive: the waypoint can only see test-17-09 on the call to api if web copied it into its own request, since client only talks to web.

Terminal window
kubectl -n boutique exec client -- curl -s -o /dev/null -w '%{http_code} %{time_total}s\n' -H 'x-request-id: test-17-09' -X POST -d bonjour http://web.boutique:9898/echo
kubectl -n boutique logs deploy/waypoint --since-time=2026-11-17T19:32:08Z | grep '"POST '
200 1.426949s
[2026-11-17T19:32:08.996Z] "POST /echo HTTP/1.1" 202 - via_upstream - "-" 7 7 1421 1421 "-" "Go-http-client/1.1" "test-17-09" "api.boutique:9898" "envoy://connect_originate/10.244.38.66:9898" inbound-vip|9898|http|api.boutique.svc.cluster.local …
[2026-11-17T19:32:08.994Z] "POST /echo HTTP/1.1" 200 - via_upstream - "-" 7 15 1425 1425 "-" "curl/8.17.0" "test-17-09" "web.boutique:9898" "envoy://connect_originate/10.244.223.31:9898" inbound-vip|9898|http|web.boutique.svc.cluster.local …

Both lines carry "test-17-09", the field that follows the client. Replace the --since-time date with the time of your request. The same test, run with web without --otel-service-name, gives the same two lines: podinfo copies x-request-id even without tracing, whereas it copies traceparent only when tracing is enabled. With another application, the two lines of the access log only link up if it copies this header into its outgoing calls.

After the two byte counts, received and sent (7 7 and 7 15), the next two numbers are the total duration of the request then the upstream response time, in milliseconds. The call to api lasts 1184 ms, and the one to web 1192 ms. The gap is only 8 ms: the time was spent in api, which the trace had already shown.

Why does the ztunnel duration not give a request's latency?

ztunnel sees TCP connections, not HTTP requests. It writes its connection complete line only when the connection closes, and the duration it carries is the lifetime of the connection.

To read these lines, you first need to find the ztunnel of the right node, because there is one per node. The NODE column of the first following command gives each node's ztunnel Pod, the second the node of client and web.

Terminal window
kubectl -n istio-system get pods -l app=ztunnel -o wide
kubectl -n boutique get pods -o wide

The output reproduced below is that of the first command.

NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
ztunnel-76dcz 1/1 Running 0 21m 10.244.38.95 k8s-w1.lab <none> <none>
ztunnel-8rgr7 1/1 Running 0 21m 10.244.163.60 k8s-cp.lab <none> <none>
ztunnel-dxl8m 1/1 Running 0 21m 10.244.223.5 k8s-w2.lab <none> <none>

Take the current node of client and web: web was recreated since the first node reading and may have changed node. In this example, client runs on k8s-w1.lab and web on k8s-w2.lab. The two Pods whose lines you read are therefore ztunnel-76dcz and ztunnel-dxl8m.

ztunnel writes a connection complete line with direction="outbound" on the source's node. A direction="inbound" line appears only on the node of a destination application Pod, like the error line quoted further down, which targets web. A connection to the waypoint therefore leaves only the outbound line of the source node in the logs.

Read these lines with kubectl -n istio-system logs <ztunnel pod>, filtered on the namespace's access lines. Replace the --since-time value with the time of your three requests.

Terminal window
kubectl -n istio-system logs ztunnel-76dcz --since-time=2026-11-17T19:02:46Z | grep -E 'access' | grep -E 'boutique'

The three durations of ztunnel-76dcz, the ztunnel of client's node (duration="1197ms", "1159ms" and "1317ms"), look like those of the waypoint (if you have already run the x-request-id test, its line is added to them): curl opens one connection per request, so each connection carries a single request.

Between web and the waypoint, it is different. web's Go client keeps its connection open and reuses it for several requests, and ztunnel-dxl8m, the one on web's node, wrote nothing for this connection as long as web was running. After a kubectl -n boutique rollout restart deploy/web, it closes, and ztunnel-dxl8m writes a single line for this connection. Here, --since-time takes the time of the restart.

Terminal window
kubectl -n istio-system logs ztunnel-dxl8m --since-time=2026-11-17T19:03:16Z | grep 'access' | grep 'boutique'
2026-11-17T19:03:20.225151Z info access connection complete src.addr=10.244.223.28:41222 src.workload="web-54b544bd67-kxc2r" … dst.service="api.boutique.svc.cluster.local" dst.workload="waypoint-c9749c48f-q9rs6" … direction="outbound" bytes_sent=1950 bytes_recv=1050 duration="33703ms"

The complete output has four lines; this one is the connection from web to the waypoint. Two others are the connections from web to otel-collector (duration="639450ms" and "630482ms"): they illustrate the same point, a connection lifetime and not a latency. The fourth, the error line, is quoted below.

The line from web to the waypoint reports duration="33703ms" and bytes_sent=1950 for a connection that carried several requests: these figures add up everything that passed during 33.7 seconds, so they are not the latency of any request. Only the waypoint, which reads HTTP, gives the duration of a request.

At the same restart, ztunnel writes an error level line for the connection between the waypoint and the old web Pod, with error="send: io error: stream error received: unexpected internal error encountered". This is not a failure: the connection was cut because the Pod was stopped.

What should you protect before tracing outside a lab?

Traces contain data that does not belong everywhere, and this lesson's demonstration leaves it unprotected. Spans carry the full URL of the request (http.url or url.full), so possibly a query string with a token, and Pod addresses: filter the sensitive attributes in the collector before they reach storage.

Jaeger has no authentication in this demonstration. It must not be exposed outside the cluster: reach it with kubectl port-forward, as here. Finally, the OTLP export travels in clear text, without encryption (tls: {insecure: true} between the collector and Jaeger): outside a demonstration, encrypt it.

Troubleshooting

When a trace is missing, move along the path of the spans in order: does the waypoint see the request, does it create the span, does it deliver it to the collector, does Jaeger keep it, and then did the application propagate the context.

The following diagram orders the first three checks. Go down it as long as the answer does not point to a failure: the box on the right gives the cause as soon as it is found, and the last box, at the bottom, covers the case where the mesh is correctly configured.

Decision tree for a trace missing from Jaeger. If the waypoint does not count requests in istio_requests_total, it sees nothing: namespace not enrolled or waypoint Pod at 0/1. Otherwise, if its debug log reports an export failure, add appProtocol grpc to port 4317 of the collector Service. Otherwise, if the istio ConfigMap does not declare the provider, declare it in meshConfig and reapply. Otherwise, the Telemetry is missing or the rate is below 100%, and the request has no span.No tracein JaegerDoes the waypoint count requestsin istio_requests_total?The waypoint sees nothing:namespace not enrolled,waypoint Pod at 0/1 no Does the waypoint debug logreport an export failure? yes Export refused: addappProtocol grpc to theService port 4317 yes Does the istio ConfigMapdeclare the provider? no Unknown provider: declare itin meshConfig, thenreapply no Telemetry missing or ratebelow 100%: the requesthas no span yes 
Source · SVG
Esc to close, + and − to zoom, scroll to move around. 100 %

The table details these cases and adds those that concern reading in Jaeger and the access log.

SymptomLikely causeFix
/api/services returns 404 page not found on Jaeger/api/* is Jaeger's internal, undocumented API, and it does not answer on 2.23.0Use /api/v3/services and /api/v3/traces?query.serviceName=…
Jaeger returns exactly 20 traces although you sent more requestsThe list is cut at the query.searchDepth limit, with no messageTake a searchDepth higher than the number of traces you expect
Requests right after istioctl waypoint apply --wait fail with 000 and a curl code 56 or 52The waypoint Pod is still 0/1 while the traffic is already divertedWait with kubectl wait --for=condition=Ready pod -l gateway.networking.k8s.io/gateway-name=waypoint before sending traffic
No trace, and the collector's log shows no Traces lineNo waypoint for the namespace: ztunnel alone produces no HTTP spanDeploy the waypoint and enroll the namespace with --enroll-namespace
istio_requests_total counts the requests, but Jaeger receives nothingThe collector Service's port is named otlp-grpc without appProtocol: every export fails with Unavailable … protocol error, and the collector says nothingAdd appProtocol: grpc to the Service's port 4317, or name the port grpc or with the grpc- prefix, then reread the waypoint's log in debug
No span although a Telemetry names otel-tracingThe provider is not declared in meshConfig.extensionProviders: the Telemetry points to an unknown nameRead kubectl -n istio-system get configmap istio -o jsonpath='{.data.mesh}', then reapply the IstioOperator file with the extensionProviders block
A trace of one span per hop, with no link between themThe application does not copy traceparent into its outgoing callsEnable propagation in the application (here podinfo's --otel-service-name=web)
The waypoint's log contains no POST line although requests go throughNo Telemetry resource enables accessLogging for the waypoint, or it targets it with a selectorCreate a Telemetry with targetRefs to the waypoint's Gateway and the envoy provider
A ztunnel error line "stream error received" right after a Pod restartThe connection to the old Pod was cut by its shutdownNothing to fix: reread the log on the new Pod
A slow request stays missing in Jaeger while others are thereIt was not sampled, if randomSamplingPercentage is below 100Raise the rate for the time of the diagnosis, then lower it again

Put it into practice

Replay the demonstration on your cluster, in this order: set up the collector and Jaeger, declare the otel-tracing provider, create the Telemetry resource, deploy the client, web and api chain, then its waypoint, waiting for its Pod. Then find out yourself why Jaeger lists only jaeger, fix the collector's port, enable propagation on web and name the service that adds the latency. You have succeeded when a single trace shows the slow service, without having to guess it from two close durations.

To check that you understood the reading and not just the example, change the scenario: run api without --random-delay and give the delay to a third service that web calls, then find that slow service from the trace alone. So that the slow service is not known in advance, have someone else set the delay, or use a small script that randomly picks the service that receives it.

The guided lab takes up this path again on an Istio cluster in ambient mode. The setup places the slow service at random between two services of the chain, and you write its name in the diagnostic ConfigMap of the boutique namespace, key service-lent. The validation checks six requirements: the opentelemetry provider declared toward the collector on port 4317, a mesh-wide Telemetry at 100 %, a Programmed waypoint whose Pod is Ready, waypoint spans received by Jaeger during the check, a single trace that links web to the hop toward the slow service, and the right name in the ConfigMap.

Once the exercise is over, clean up the cluster.

Terminal window
kill %1
kubectl -n istio-system delete telemetry mesh-default
kubectl -n boutique delete telemetry journal-acces-waypoint
kubectl delete namespace boutique observabilite

kill %1 stops the port-forward started in the background in this terminal, if it is the first job (jobs gives its number). The first two deletions remove the Telemetry resources, and the last one the boutique namespace (chain and waypoint) and the observabilite namespace (collector and Jaeger). The otel-tracing provider in meshConfig can stay in place: without a Telemetry resource, nobody uses it.

Key points

  • In ambient mode, the ztunnel works at layer 4: without a waypoint, no HTTP span is produced.
  • istioctl waypoint apply --wait prints is ready! while the waypoint Pod may be 0/1: wait for it with kubectl wait --for=condition=Ready.
  • A provider is declared in meshConfig.extensionProviders, and the Telemetry resource enables it with randomSamplingPercentage: 100% suits a diagnosis, not production, and at a lower rate a request that is not selected has no span, even a slow one.
  • A Service port named otlp-grpc without appProtocol: grpc makes every waypoint export fail, with no message on the collector side. istio_requests_total shows that the waypoint sees the requests, and the waypoint's tracing log in debug shows the export failure.
  • Jaeger 2.23.0 is read through the v3 API: /api/v3/services and /api/v3/traces?query.serviceName=….
  • The mesh does not propagate the context in place of the application: without a copy of traceparent, each hop forms its own trace.
  • In a complete trace, the slow hop is the one where the parent span spends almost all its time waiting: here web waits 1391 ms out of 1394 ms, so api is slow.
  • The waypoint's access log is enabled by a Telemetry with targetRefs to its Gateway; its x-request-id links the hops when the application copies it, and only the waypoint's duration is that of a request, not ztunnel's.

Knowledge check

Eight diagnosis questions, drawn at random from nineteen: the waypoint's role, the moment a waypoint is ready, the declaration of the provider and of the Telemetry resource, the export failure caused by the collector's port, Jaeger 2's API and the searchDepth limit, context propagation, reading a trace and the traps of the jq filter, the waypoint's access log, the ztunnel duration, a slow request missing from Jaeger for lack of sampling and the sensitive data in spans.

Knowledge check

Check what you have learned with this interactive quiz

8 questions
8 min
70% to pass

How it works

  • The timer starts when you click Start
  • Multiple choice, true/false and short answer questions
  • You can move between questions
  • Detailed results are shown at the end

Starts the quiz and the timer