Language and Page Formatting Options
Chapter 8. Tracing requests
Distributed tracing records the path of a request through the various services that make up an application. It is used to tie information about different units of work together, to understand a whole chain of events in a distributed transaction. The units of work might be executed in different processes or hosts.
8.1. Using Jaeger to enable distributed tracing
If you do not want to install all of the components of Red Hat OpenShift distributed tracing, you can still use distributed tracing on OpenShift Dedicated with OpenShift Serverless. To do this, you must install and configure Jaeger as a standalone integration.
- You have access to an OpenShift Dedicated account with cluster or dedicated administrator access.
- You have installed the OpenShift Serverless Operator and Knative Serving.
- You have installed the Red Hat OpenShift distributed tracing platform Operator.
You have installed the OpenShift CLI (
- You have created a project or have access to a project with the appropriate roles and permissions to create applications and other workloads in OpenShift Dedicated.
Create and apply a
Jaegercustom resource (CR) that contains the following:
apiVersion: jaegertracing.io/v1 kind: Jaeger metadata: name: jaeger namespace: default
Enable tracing for Knative Serving, by editing the
KnativeServingCR and adding a YAML configuration for tracing:
Tracing YAML example
apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: config: tracing: sample-rate: "0.1" 1 backend: zipkin 2 zipkin-endpoint: "http://jaeger-collector.default.svc.cluster.local:9411/api/v2/spans" 3 debug: "false" 4
sample-ratedefines sampling probability. Using
sample-rate: "0.1"means that 1 in 10 traces are sampled.
backendmust be set to
zipkin-endpointmust point to your
jaeger-collectorservice endpoint. To get this endpoint, substitute the namespace where the Jaeger CR is applied.
- Debugging should be set to
false. Enabling debug mode by setting
debug: "true"allows all spans to be sent to the server, bypassing sampling.
You can access the Jaeger web console to see tracing data, by using the
jaegerroute’s hostname by entering the following command:
$ oc get route jaeger -n default
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD jaeger jaeger-default.apps.example.com jaeger-query <all> reencrypt None
- Open the endpoint address in your browser to view the console.