此内容没有您所选择的语言版本。

Chapter 3. Distributed tracing and Service Mesh


Integrate Red Hat OpenShift distributed tracing platform with Red Hat OpenShift Service Mesh by using Red Hat OpenShift distributed tracing platform (Tempo) for distributed tracing platform storage and Red Hat OpenShift distributed tracing data collection for standardized telemetry data collection and processing.

Two parts integrate Red Hat OpenShift distributed tracing platform with Red Hat OpenShift Service Mesh: Red Hat OpenShift distributed tracing platform (Tempo) and Red Hat OpenShift distributed tracing data collection.

Red Hat OpenShift distributed tracing platform (Tempo)

Provides distributed tracing platform to monitor and troubleshoot transactions in complex distributed systems. Tempo derives its core functionality from the open source Grafana Tempo project.

For more about information about distributed tracing platform (Tempo), its features, installation, and configuration, see, "Red Hat OpenShift distributed tracing platform (Tempo)".

Red Hat OpenShift distributed tracing data collection

Derives its core functionality from the open source "OpenTelemetry project", which aims to offer unified, standardized, and vendor-neutral telemetry data collection for cloud-native software. Red Hat OpenShift distributed tracing data collection product provides support for deploying and managing the OpenTelemetry Collector and simplifying the instrumentation of workloads.

The "OpenTelemetry Collector" can receive, process, and forward telemetry data in many formats, making it the ideal component for telemetry processing and interoperability between telemetry systems. The Collector provides a unified solution for collecting and processing metrics, traces, and logs.

For more information about distributed tracing data collection, its features, installation, and configuration, see: "Red Hat OpenShift distributed tracing data collection".

You can integrate Red Hat OpenShift Service Mesh with Red Hat OpenShift distributed tracing data collection to instrument, generate, collect, and export OpenTelemetry traces, metrics, and logs to analyze and understand the performance and behavior of the software.

Prerequisites

  • You have installed the Tempo Operator. For more information, see "Installing the Tempo Operator".
  • You have installed the Red Hat OpenShift distributed tracing data collection Operator. For more information, see "Installing the Red Hat build of OpenTelemetry".
  • You have installed a TempoStack and configured it in a tempo namespace. For more information, see "Installing a TempoStack instance".
  • You have created an Istio instance.
  • You have created an IstioCNI instance.

Procedure

  1. Navigate to the Red Hat OpenShift distributed tracing data collection Operator and install the OpenTelemetryCollector resource in the istio-system namespace, similar to the following example:

    kind: OpenTelemetryCollector
    apiVersion: opentelemetry.io/v1beta1
    metadata:
      name: otel
      namespace: istio-system
    spec:
      observability:
        metrics: {}
      deploymentUpdateStrategy: {}
      config:
        exporters:
          otlp:
            endpoint: 'tempo-sample-distributor.tempo.svc.cluster.local:4317'
            tls:
              insecure: true
        receivers:
          otlp:
            protocols:
              grpc:
                endpoint: '0.0.0.0:4317'
              http: {}
        service:
          pipelines:
            traces:
              exporters:
                - otlp
              receivers:
                - otlp
  2. Update the Red Hat OpenShift Service Mesh Istio custom resource (CR) to enable tracing and define the distributed tracing data collection tracing providers in your meshConfig, similar to the following example:

    apiVersion: sailoperator.io/v1
    kind: Istio
    metadata:
    #  ...
      name: default
    spec:
      namespace: istio-system
    #  ...
      values:
        meshConfig:
          enableTracing: true
          extensionProviders:
          - name: otel
            opentelemetry:
              port: 4317
              service: otel-collector.istio-system.svc.cluster.local
    • spec.values.meshConfig.ExtensionProviders.opentelemetry.service is the OpenTelemetry collector service in the istio-system namespace.
  3. Create an Istio Telemetry resource to enable tracers defined in spec.values.meshConfig.ExtensionProviders, similar to the following example:

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

    After you verify that you can see traces, lower the randomSamplingPercentage value or set it to default to reduce the number of requests.

    Note

    You can use a single Istio Telemetry resource for both the Prometheus metrics provider and a tracing provider by setting spec.metrics.overrides.disabled to false. This enables the Prometheus metrics provider. This is an optional step and you can skip it if you configured metrics through the OpenShift Cluster Monitoring method described in the earlier step.

  4. Create the bookinfo namespace by running the following command:

    $ oc create ns bookinfo
  5. Depending on the update strategy you are using, enable sidecar injection in the namespace by running the appropriate commands:

    1. If you are using the InPlace update strategy, run the following command:

      $ oc label namespace curl istio-injection=enabled
    2. If you are using the RevisionBased update strategy, run the following commands:

      1. Display the revision name by running the following command:

        $ oc get istiorevisions.sailoperator.io

        You should see output similar to the following example:

        NAME      TYPE    READY   STATUS    IN USE   VERSION   AGE
        default   Local   True    Healthy   True     v1.24.3   3m33s
      2. Label the namespace with the revision name to enable sidecar injection by running the following command:

        $ oc label namespace curl istio.io/rev=default
  6. Deploy the bookinfo application in the bookinfo namespace by running the following command:

    $ oc apply -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.24/samples/bookinfo/platform/kube/bookinfo.yaml -n bookinfo
  7. Generate traffic to the productpage pod to generate traces:

    $ oc exec -it -n bookinfo deployments/productpage-v1 -c istio-proxy -- curl localhost:9080/productpage
  8. Validate the integration by running the following command to see traces in the UI:

    $ oc get routes -n tempo tempo-sample-query-frontend
    Note

    You must create the OpenShift route for the Jaeger UI in the Tempo namespace. You can either manually create it for the tempo-sample-query-frontend service, or update the Tempo custom resource with .spec.template.queryFrontend.jaegerQuery.ingress.type: route.

Generate Layer 7 (L7) tracing spans in OpenShift Service Mesh ambient mode by using waypoint or gateway proxies to capture application-level telemetry that the Layer 4 (L4) ztunnel component does not offer.

Prerequisites

  • You have installed the Tempo Operator. For more information, see "Installing the Tempo Operator".
  • You have installed the Red Hat OpenShift distributed tracing data collection Operator. For more information, see "Installing the Red Hat build of OpenTelemetry".
  • You have installed a TempoStack and configured it in a tempo namespace. For more information, see "Installing a TempoStack instance".
  • You have created an Istio instance.

Procedure

  1. Navigate to the Red Hat OpenShift distributed tracing data collection Operator and install the OpenTelemetryCollector resource in the istio-system namespace, similar to the following example:

    kind: OpenTelemetryCollector
    apiVersion: opentelemetry.io/v1beta1
    metadata:
      name: otel
      namespace: istio-system
    spec:
      mode: deployment
      observability:
        metrics: {}
      deploymentUpdateStrategy: {}
      config:
        exporters:
          otlp:
            endpoint: 'tempo-sample-distributor.tempo.svc.cluster.local:4317'
            tls:
              insecure: true
        receivers:
          otlp:
            protocols:
              grpc:
                endpoint: '0.0.0.0:4317'
              http: {}
        service:
          pipelines:
            traces:
              exporters:
                - otlp
              receivers:
                - otlp
    • spec.config.exporters.otlp.endpoint defines the Tempo sample distributor service in a namespace such as tempo.
  2. Update the Red Hat OpenShift Service Mesh Istio custom resource (CR) to define a tracing provider in the spec.values.meshConfig field, similar to the following example:

    apiVersion: sailoperator.io/v1
    kind: Istio
    metadata:
    #  ...
      name: default
    spec:
      namespace: istio-system
      profile: ambient
    #  ...
      values:
        meshConfig:
          enableTracing: true
          extensionProviders:
          - name: otel
            opentelemetry:
              port: 4317
              service: otel-collector.istio-system.svc.cluster.local
        pilot:
          trustedZtunnelNamespace: ztunnel
    • spec.values.meshConfig.extensionProviders.opentelemetry.service defines the OpenTelemetry collector service in the istio-system namespace.
  3. Create an Istio Telemetry CR to enable the tracing provider defined in the spec.values.meshConfig.ExtensionProviders field, similar to the following example:

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

    After you can see the traces, lower the randomSamplingPercentage value or set it to default to reduce the number of requests. You can also use the spec.targetRefs field to enable tracing at a gateway or a waypoint level.

  4. Optional: Use a single Istio Telemetry resource for both a Prometheus metrics provider and a tracing provider by setting spec.metrics.overrides.disabled field to false. This enables the Prometheus metrics provider. You do not need this step if you have configured metrics through the OpenShift Cluster Monitoring approach described in the earlier step.

3.1.3.1. Verifying traces in ambient mode

You can verify that the traces for your application are in ambient mode. The following example uses the Bookinfo application.

Prerequisites

  • You have deployed the Bookinfo application in ambient mode to use the following example. For more information, see "Deploying the Bookinfo application in Istio ambient mode".
  • You have deployed a waypoint proxy and enrolled the bookinfo namespace to use the waypoint. For more information, see "Deploying a waypoint proxy".

Procedure

  1. Send some traffic to the Bookinfo productpage service for generating traces by running the following command:

    $ curl "http://${GATEWAY_URL}/productpage" | grep "<title>"
  2. Verify that the Bookinfo application traces appear in a Tempo dashboard UI by running the following command:

    $ oc get routes -n tempo tempo-sample-query-frontend
  3. Select the bookinfo-gateway-istio.booinfo or the waypoint.bookinfo service from the dashboard UI.
  4. Click Find Traces.

    Note

    The TempoStack custom resource (CR) creates the route for the Tempo dashboard UI when you set the .spec.template.queryFrontend.jaegerQuery.ingress.type field to route.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部