Breadcrumb

  1. Red Hat Interactive Learning Portal
  2. OpenShift learning
  3. A seamless transition: Migrate your service mesh observability from Jaeger to OpenTelemetry
  4. Create the Jaegar instance and subscribe to Tempo

A seamless transition: Migrate your service mesh observability from Jaeger to OpenTelemetry

Learn how to migrate your service mesh observability to OpenTelemetry to ensure your instrumentation is unified and future-proofed.

Access the cloud console

For our demo, we are using the Jaeger all-in-one instance as the current tracing service, with the OpenTelemetry Collector and Tempo representing the transition and final state, respectively.

The following steps will walk us through how to migrate an existing deployment in Jaeger and adapt it into OpenTelemetry. First, we'll need to create the Jaeger instance to represent our starting point in this process.

Prerequisites:

  • Red Hat Hybrid Cloud Console access
  • A cluster running with OpenShift 

In this lesson, you will:

  • Create a Jaeger instance.
  • Create a subscription for Tempo Operator.

Create the namespace

To create a starting point in the Jaeger all-in-one memory service, we need to create the namespace for the Red Hat OpenShift distributed tracing operator. Follow these steps to create the namespace.

  1. Execute the following command within the Red Hat Hybrid Cloud Console:

    cat <<'EOF' | oc create -f-
    apiVersion: v1
    kind: Namespace
    metadata:
      name: openshift-distributed-tracing
    EOF
  2. Then create the OperatorGroup:

    cat <<'EOF' | oc create -f-
    apiVersion: operators.coreos.com/v1
    kind: OperatorGroup
    metadata:
      annotations:
        olm.providedAPIs: Jaeger.v1.jaegertracing.io
      name: openshift-distributed-tracing
      namespace: openshift-distributed-tracing
    spec:
      upgradeStrategy: Default
    EOF
  3. Next, create the subscription for the operator to upload the YAML file: 

    cat <<'EOF' | oc create -f-
    apiVersion: operators.coreos.com/v1alpha1
    kind: Subscription
    metadata:
      labels:
        operators.coreos.com/jaeger-product.openshift-distributed-tracing: ''
      name: jaeger-product
      namespace: openshift-distributed-tracing
    spec:
      channel: stable
      installPlanApproval: Automatic
      name: jaeger-product
      source: redhat-operators
      sourceNamespace: openshift-marketplace
      startingCSV: jaeger-operator.v1.65.0-4
    EOF
  4. Then create a namespace for the Jaeger service instance:

    cat <<'EOF' | oc create -f-
    apiVersion: v1
    kind: Namespace
    metadata:
      name: distributed-tracing
    EOF
  5. Finally, create a Jaeger all-in-one memory instance. This will reference the prior namespaces. 

    cat <<'EOF' | oc create -f-
    apiVersion: jaegertracing.io/v1
    kind: Jaeger
    metadata:
      name: jaeger-all-in-one-inmemory
      namespace: distributed-tracing
    EOF

Create the Tempo operator

To create a Tempo operator, follow these steps:

  1. Create a namespace for the Tempo operator by executing the following command:

    cat <<'EOF' | oc create -f-
    apiVersion: v1
    kind: Namespace
    metadata:
      name: openshift-tempo-operator
    EOF
  2. Now we have to create the OperatorGroup for Tempo to function within the namespace by inputting the following YAML:

    cat <<'EOF' | oc create -f-
    apiVersion: operators.coreos.com/v1
    kind: OperatorGroup
    metadata:
      annotations:
        olm.providedAPIs: TempoMonolithic.v1alpha1.tempo.grafana.com,TempoStack.v1alpha1.tempo.grafana.com
      name: openshift-tempo-operator
      namespace: openshift-tempo-operator
    spec:
      upgradeStrategy: Default
    EOF
  3. Next, we will have to create the subscription for the Tempo operator:

    cat <<'EOF' | oc create -f-
    apiVersion: operators.coreos.com/v1alpha1
    kind: Subscription
    metadata:
      labels:
        operators.coreos.com/tempo-product.openshift-tempo-operator: ''
      name: tempo-product
      namespace: openshift-tempo-operator
    spec:
      channel: stable
      installPlanApproval: Automatic
      name: tempo-product
      source: redhat-operators
      sourceNamespace: openshift-marketplace
      startingCSV: tempo-operator.v0.16.0-2
    EOF
  4. Then create a namespace for the TempoStack service instance:

    cat <<'EOF' | oc create -f-
    apiVersion: v1
    kind: Namespace
    metadata:
      name: tempo
    EOF
  5. Create an S3 Bucket configuration secret:

    oc -n tempo create secret generic tempo-s3 \
      --from-literal=bucket=tempo \ 
      --from-literal=endpoint=https://s3.example.com \
      --from-literal=access_key_id=access_key_id \
      --from-literal=access_key_secret=access_key_secret
  6. Then create a Tempo ServiceAccount:

    cat <<'EOF' | oc create -f-
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: tempo
      namespace: tempo
    EOF
  7. Finally, we will create a MultiTenant TempoStack instance. This configuration will provide two tenants to inject traces to start, which you can extend later (should you wish) for finer, more granular tenant separation.

    cat <<'EOF' | oc create -f- 
    apiVersion: tempo.grafana.com/v1alpha1
    kind: TempoStack
    metadata:
      labels:
        app.kubernetes.io/managed-by: tempo-operator
        tempo.grafana.com/distribution: openshift
      name: tempo
      namespace: tempo
    spec:
      extraConfig:
        tempo:
          storage:
            trace:
              s3:
                region: us-east-1
      hashRing:
        memberlist: {}
      images: {}
      limits:
        global:
          ingestion: {}
          query:
            maxSearchDuration: 0s
      managementState: Managed
      observability:
        grafana:
          instanceSelector: {}
        metrics: {}
        tracing:
          jaeger_agent_endpoint: localhost:6831
          otlp_http_endpoint: http://localhost:4320
      replicationFactor: 1
      resources: {}
      retention:
        global:
          traces: 48h0m0s
      search:
        defaultResultLimit: 20
        maxDuration: 0s
      serviceAccount: tempo
      storage:
        secret:
          name: tempo-s3
          type: s3
        tls:
          enabled: true
      storageSize: 1Gi
      template:
        compactor:
          replicas: 1
        distributor:
          component:
            replicas: 1
          tls:
            enabled: false
        gateway:
          component:
            replicas: 1
          enabled: true
          ingress:
            route:
              termination: reencrypt
            type: route
          rbac:
            enabled: false
        ingester:
          replicas: 1
        querier:
          replicas: 1
        queryFrontend:
          component:
            replicas: 1
          jaegerQuery:
            enabled: true
            ingress:
              route: {}
            monitorTab:
              enabled: true
              prometheusEndpoint: https://thanos-querier.openshift-monitoring.svc.cluster.local:9091
            servicesQueryDuration: 72h0m0s
            tempoQuery: {}
      tenants:
        authentication:
          - tenantId: 1610b0c3-c509-4592-a256-a1871353dbfa
            tenantName: user
          - tenantId: 1610b0c3-c509-4592-a256-a1871353dbfb
            tenantName: platform
        mode: openshift
      timeout: 30s
    EOF

Now that we have set up our demonstration instance, we’re ready to create visibility with an observability operator. 

Previous resource
Requirements for Jaeger to OpenTelemetry transition
Next resource
Set up OpenTelemetry