Skip to content

jboss-fuse/fuse-istio-distributed-tracing-booster

Repository files navigation

Istio Distributed Tracing - Fuse Booster

Overview

The Fuse Istio Distributed Tracing booster demonstrates Istio’s Distributed Tracing via a (minimally) instrumented set of Apache Camel/Spring Boot applications:

  • A name service that returns a name to greet.

  • A greeting service that invokes the name service to get a name and then returns the Hello, NAME string.

When you run this booster, it injects Istio envoy proxy sidecars containers and both applications become part of a "service mesh". Istio automatically gathers tracing information by following the flow of a request across the services.

Deployment options

You can run this booster in the following modes:

Prerequisites

  • Java 8 JDK (or later)

  • Maven 3.3.x (or later)

  • OpenShift 3.10 (or later) / Kubernetes 1.10 (or later) cluster

  • Istio 1.0.x installed on the cluster

    If Istio is not installed and you have admin privileges, you can install it using the Istio Operator by following these instructions.

  • rewriteAppHTTPProbe: true or mTSL disabled as explained in Istio app health check probe rewritel

As part of the process of creating this booster, https://developers.redhat.com/launch sets up a project with a CI/CD deployment of this booster. You can see the status of this deployment in your single-node OpenShift cluster or OpenShift Online web console.

Running the booster on a single-node OpenShift cluster

A single-node OpenShift cluster provides you with access to a cloud environment that is similar to a production environment.

If you have a single-node OpenShift cluster, such as Minishift or the Red Hat Container Development Kit, installed and running, you can deploy your booster there.

For more details about running this booster on a single-node OpenShift cluster, CI/CD deployments, as well as the rest of the runtime, see the Spring Boot Runtime Guide.

To deploy this booster to a running single-node OpenShift cluster:

  1. Download the booster project and extract the archive on your local file system.

  2. Log in to your OpenShift cluster:

    $ oc login -u system:admin
  3. Create a new OpenShift project for the booster:

    $ oc new-project MY_PROJECT_NAME
  4. Change the directory to the folder that contains the extracted booster application (for example, my_openshift/fuse-istio-distributed-tracing-booster) :

    $ cd my_openshift/fuse-istio-distributed-tracing-booster
  5. Build and deploy the project to the OpenShift cluster:

    $ mvn clean -DskipTests fabric8:deploy -Popenshift
  6. If your environment does not support automatic sidecar injection, you must manually inject the Istio sidecar envoy proxy:

    $ oc get dc name-service -o yaml | <istio_install_directory>/bin/istioctl kube-inject -f - | oc apply -f -
    $ oc get dc greetings-service -o yaml | <istio_install_directory>/bin/istioctl kube-inject -f - | oc apply -f -
  7. Create a RouteRule to forward traffic from istio-ingress to the booster application:

    $ oc create -f istio/greetings-gateway.yaml
    Important
    for how the istio gateway used in this example is configured this must be the only resource on the cluster of type gateway.networking.istio.io.
  8. Access the application through istio-ingress:

    1. Run the following command to retrieve the appropriate URL to access the booster application:

      Note: Make sure you that you specify the URL with the HTTP scheme. HTTPS is not enabled by default.

      $ echo http://$(oc get route istio-ingressgateway -o jsonpath='{.spec.host}{"\n"}' -n istio-system)/camel/greetings/

      The command returns the istio-system istio-ingress URL, appended with the RouteRule path.

    2. Open the returned URL in a web browser. You should see the json output of the Greetings REST service.

    3. Now you can access the Jaeger tracing dashboard and found data of the just completed REST invocation.

      After a few seconds, after all the spans have been collected, the traces from the invocation of the REST endpoint should look similar to the following example:

      trace

Running the booster on OpenShift Online

To deploy the Fuse Istio distributed tracing booster directly to OpenShift Online:

  1. Go to https://developers.redhat.com/launch and login.

  2. Click Launch Your Project.

  3. Follow the on-screen instructions to create an application. Select Code Locally, Build and Deploy, Istio - Distributed Tracing mission, and the Fuse runtime.