1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-07 00:48:01 +01:00
Files
openshift-docs/modules/ossm-tutorial-jaeger-generating-traces.adoc
2020-10-06 16:48:41 -04:00

54 lines
3.3 KiB
Plaintext

////
This PROCEDURE module included in the following assemblies:
* service_mesh/v1x/prepare-to-deploy-applications-ossm.adoc
* service_mesh/v2x/prepare-to-deploy-applications-ossm.adoc
////
[id="generating-sample-traces-analyzing-trace-data_{context}"]
= Generating example traces and analyzing trace data
Jaeger is an open source distributed tracing system. You use Jaeger for monitoring and troubleshooting microservices-based distributed systems. Using Jaeger you can perform a trace, which follows the path of a request through various microservices that make up an application. Jaeger is installed by default as part of the {ProductShortName}.
This tutorial uses {ProductShortName} and the bookinfo tutorial to demonstrate how you can use Jaeger to perform distributed tracing.
[NOTE]
====
The Bookinfo example application allows you to test your {ProductName} {ProductVersion} installation on {product-title}.
Red Hat does not provide support for the Bookinfo application.
====
This tutorial uses {ProductShortName} and the Bookinfo tutorial to demonstrate how you can perform a trace using the Jaeger component of {ProductName}.
.Prerequisites:
* {product-title} 4.1 or higher installed.
* {ProductName} {ProductVersion} installed.
* Jaeger enabled during the installation.
* Bookinfo example application installed.
.Procedure
. After you have deployed the Bookinfo application you will need to generate calls to the Bookinfo application so that you have some trace data to analyze. Access http://<GATEWAY_URL>/productpage and refresh the page a few times to generate some trace data.
. The installation process creates a route to access the Jaeger console.
.. In the {product-title} console, navigate to *Networking* -> *Routes* and search for the Jaeger route, which is the URL listed under *Location*.
.. Use the CLI to query for details of the route:
+
----
$ export JAEGER_URL=$(oc get route -n bookinfo jaeger-query -o jsonpath='{.spec.host}')
----
+
. Launch a browser and navigate to `https://<JAEGER_URL>`.
. If necessary, log in using the same user name and password as you use to access the {product-title} console.
. In the left pane of the Jaeger dashboard, from the Service menu, select "productpage" and click the *Find Traces* button at the bottom of the pane. A list of traces is displayed, as shown in the following image:
+
image::ossm-jaeger-main-screen.png[]
+
. Click one of the traces in the list to open a detailed view of that trace. If you click on the top (most recent) trace, you see the details that correspond to the latest refresh of the ``/productpage`.
+
image::ossm-jaeger-spans.png[]
+
The trace in the previous figure consists of a few nested spans, each corresponding to a Bookinfo Service call, all performed in response to a ``/productpage` request. Overall processing time was 2.62s, with the *details* Service taking 3.56ms, the *reviews* Service taking 2.6s, and the *ratings* Service taking 5.32ms. Each of the calls to remote Services is represented by a client-side and server-side span. For example, the *details* client-side span is labeled `productpage details.myproject.svc.cluster.local:9080`. The span nested underneath it, labeled `details details.myproject.svc.cluster.local:9080`, corresponds to the server-side processing of the request. The trace also shows calls to *istio-policy*, which reflect authorization checks made by Istio.