Configure Istio Telemetry

With the collector deployed and configured to export data to Cloud Observability we now need to configure Istio to use OpenTelemetry and send the telemetry data to the collector.

  1. Create a new file named istio-telemetry.yaml
  2. Add the following ConfigMap to the file. This configures Istio to use OpenTelemetry for tracing and configures the service (the collector) where it should send the OpenTelemetry data.
apiVersion: v1
kind: ConfigMap
metadata:
  name: istio
  namespace: istio-system
  annotations:
    meta.helm.sh/release-name: istiod
    meta.helm.sh/release-namespace: istio-system
  labels:
    app.kubernetes.io/managed-by: Helm
    install.operator.istio.io/owning-resource: unknown
    istio.io/rev: default
    operator.istio.io/component: Pilot
    release: istiod
data:
  meshNetworks: |-
        networks: {}

  mesh: |-
    defaultConfig:
      discoveryAddress: istiod.istio-system.svc:15012
      tracing: {}
    defaultProviders:
      tracing:
        - opentelemetry
    extensionProviders:
      - name: "opentelemetry"
        opentelemetry:
          service: "opentelemetry-collector.istio-system.svc.cluster.local"
          port: 4317
    enablePrometheusMerge: true
    rootNamespace: null
    trustDomain: cluster.local    
  1. Next add the following Telemetry configuration to the file. This configures Istio to use the configuration created above for telemetry.
apiVersion: telemetry.istio.io/v1alpha1
kind: Telemetry
metadata:
  name: mesh-default
  namespace: istio-system
spec:
  accessLogging:
    - providers:
        - name: opentelemetry
  tracing:
    - providers:
        - name: opentelemetry
      randomSamplingPercentage: 100
  1. Deploy the configuration in the istio-system namespace
kubectl apply -f istio-telemetry.yaml -n istio-system

Restart Your Workloads

Anytime the Istio configuration is updated you need to restart your workloads so the sidecars get re-injected with the updated configuration. The following is an example of how to restart a deployment:

kubectl rollout restart deployment -n NAMESPACE DEPLOYMENT_NAME

Restart the Bookinfo deployments before proceeding. The following will give you a list of deployments. If using a namespace other than the default namespace be sure to add -n NAMESPACE to the following command

kubectl get deployments

Istio is now configured to use OpenTelemetry for distributed tracing and send the tracing data to the OpenTelemetry Collector. Let’s test it all out and review the data in Cloud Observability.

next: Test and Review the Results