<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Kiali – Kiali and Grafana Tempo Query integration</title>
    <link>https://v2-24.kiali.io/docs/tutorials/tempo/</link>
    <description>Recent content in Kiali and Grafana Tempo Query integration on Kiali</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    
	  <atom:link href="https://v2-24.kiali.io/docs/tutorials/tempo/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Docs: Introduction</title>
      <link>https://v2-24.kiali.io/docs/tutorials/tempo/01-introduction/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://v2-24.kiali.io/docs/tutorials/tempo/01-introduction/</guid>
      <description>
        
        
        &lt;h3 id=&#34;introduction&#34;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;Kiali uses &lt;a href=&#34;https://v2-24.kiali.io/docs/configuration/p8s-jaeger-grafana/tracing/jaeger/&#34;&gt;Jaeger&lt;/a&gt; as a default distributed tracing backend. In this tutorial, we will replace it for &lt;a href=&#34;https://grafana.com/docs/tempo/next/&#34;&gt;Grafana Tempo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We will setup a local environment in minikube, and install Kiali with Tempo as a distributed backend. This is a simplified architecture diagram:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://v2-24.kiali.io/images/tutorial/tempo/kiali-tempo.png&#34; alt=&#34;Kiali Tempo Architecture&#34; title=&#34;Kiali Tempo integration architecture&#34;&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We will install Tempo with the Tempo Operator and enable Jaeger query frontend to be compatible with Kiali in order to query traces.&lt;/li&gt;
&lt;li&gt;We will setup Istio to send traces to the Tempo collector using the zipkin protocol. It is enabled by default from version 3.0 or higher of the Tempo Operator.&lt;/li&gt;
&lt;li&gt;We will install MinIO and setup it up as object store, S3 compatible.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;environment&#34;&gt;Environment&lt;/h3&gt;
&lt;p&gt;We use the following environment:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Istio 1.18.1&lt;/li&gt;
&lt;li&gt;Kiali 1.72&lt;/li&gt;
&lt;li&gt;Minikube 1.30&lt;/li&gt;
&lt;li&gt;Tempo operator TempoStack v3.0&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are different installation methods for Grafana Tempo, but in this tutorial we will use the &lt;a href=&#34;https://grafana.com/docs/tempo/latest/setup/operator/&#34;&gt;Tempo operator&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: Kiali and Tempo setup</title>
      <link>https://v2-24.kiali.io/docs/tutorials/tempo/02-kiali-tempo-integration/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://v2-24.kiali.io/docs/tutorials/tempo/02-kiali-tempo-integration/</guid>
      <description>
        
        
        &lt;h3 id=&#34;steps-to-install-kiali-and-grafana-tempo&#34;&gt;Steps to install Kiali and Grafana Tempo&lt;/h3&gt;
&lt;p&gt;We will start minikube:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;minikube start
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It is a requirement to have cert-manager installed:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Install the operator. It is important to download a version 3.0 or higher. In previous versions, the zipkin collector was not exposed, there was no way to change it as it was not defined in the CRD.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl apply -f https://github.com/grafana/tempo-operator/releases/download/v0.3.0/tempo-operator.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We will create the tempo namespace:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl create namespace tempo
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We will deploy minio, this is a sample minio.yaml:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  # This name uniquely identifies the PVC. Will be used in deployment below.
  name: minio-pv-claim
  labels:
    app: minio-storage-claim
spec:
  # Read more about access modes here: http://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes
  accessModes:
    - ReadWriteOnce
  resources:
    # This is the request for storage. Should be available in the cluster.
    requests:
      storage: 5Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: minio
spec:
  selector:
    matchLabels:
      app: minio
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        # Label is used as selector in the service.
        app: minio
    spec:
      # Refer to the PVC created earlier
      volumes:
        - name: storage
          persistentVolumeClaim:
            # Name of the PVC created earlier
            claimName: minio-pv-claim
      initContainers:
        - name: create-buckets
          image: busybox:1.28
          command:
            - &amp;#34;sh&amp;#34;
            - &amp;#34;-c&amp;#34;
            - &amp;#34;mkdir -p /storage/tempo-data&amp;#34;
          volumeMounts:
            - name: storage # must match the volume name, above
              mountPath: &amp;#34;/storage&amp;#34;
      containers:
        - name: minio
          # Pulls the default Minio image from Docker Hub
          image: minio/minio:latest
          args:
            - server
            - /storage
            - --console-address
            - &amp;#34;:9001&amp;#34;
          env:
            # Minio access key and secret key
            - name: MINIO_ACCESS_KEY
              value: &amp;#34;minio&amp;#34;
            - name: MINIO_SECRET_KEY
              value: &amp;#34;minio123&amp;#34;
          ports:
            - containerPort: 9000
            - containerPort: 9001
          volumeMounts:
            - name: storage # must match the volume name, above
              mountPath: &amp;#34;/storage&amp;#34;
---
apiVersion: v1
kind: Service
metadata:
  name: minio
spec:
  type: ClusterIP
  ports:
    - port: 9000
      targetPort: 9000
      protocol: TCP
      name: api
    - port: 9001
      targetPort: 9001
      protocol: TCP
      name: console
  selector:
    app: minio
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And apply the yaml:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl apply -n tempo -f minio.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We will create a secret to access minio:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl create secret generic -n tempo tempostack-dev-minio \
--from-literal=bucket=&amp;#34;tempo-data&amp;#34; \
--from-literal=endpoint=&amp;#34;http://minio:9000&amp;#34; \
--from-literal=access_key_id=&amp;#34;minio&amp;#34; \
--from-literal=access_key_secret=&amp;#34;minio123&amp;#34;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Install Grafana tempo with the operator. We will use the secret created in the previous step:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl apply -n tempo -f - &amp;lt;&amp;lt;EOF
apiVersion: tempo.grafana.com/v1alpha1
kind: TempoStack
metadata:
  name: smm
spec:
  storageSize: 1Gi
  storage:
    secret:
      type: s3
      name: tempostack-dev-minio
  resources:
    total:
      limits:
        memory: 2Gi
        cpu: 2000m
  template:
    queryFrontend:
      jaegerQuery:
        enabled: true
        ingress:
          type: ingress
EOF
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As an optional step, we can check if all the deployments have started correctly, and the services distributor has the port 9411 and the query frontend 16686:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl get all -n tempo
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img src=&#34;https://v2-24.kiali.io/images/tutorial/tempo/tempo-services.png&#34; alt=&#34;Tempo Services&#34; title=&#34;Tempo Services&#34;&gt;&lt;/p&gt;
&lt;p&gt;(Optional) We can test if minio is working with a batch job to send some traces, in this case, to the open telemetry collector:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl apply -f - &amp;lt;&amp;lt;EOF
apiVersion: batch/v1
kind: Job
metadata:
  name: tracegen
spec:
  template:
    spec:
      containers:
        - name: tracegen
          image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/tracegen:latest
          command:
            - &amp;#34;./tracegen&amp;#34;
          args:
            - -otlp-endpoint=tempo-smm-distributor.tempo.svc.cluster.local:4317
            - -otlp-insecure
            - -duration=30s
            - -workers=1
      restartPolicy: Never
  backoffLimit: 4
EOF
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And access the minio console:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl port-forward --namespace istio-system service/minio 9001:9001
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img src=&#34;https://v2-24.kiali.io/images/tutorial/tempo/minio.png&#34; alt=&#34;MinIO console&#34; title=&#34;MinIO console&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;install-istio-with-helm-option-i&#34;&gt;Install Istio with helm (Option I)&lt;/h2&gt;
&lt;p&gt;Istio can be installed with Helm following the &lt;a href=&#34;https://istio.io/latest/docs/setup/install/helm/&#34;&gt;instructions&lt;/a&gt;.
The zipkin address needs to be set:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;--set values.meshConfig.defaultConfig.tracing.zipkin.address=&amp;#34;tempo-smm-distributor.tempo:9411&amp;#34;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And then, install &lt;a href=&#34;https://istio.io/latest/docs/ops/integrations/jaeger/#option-1-quick-start&#34;&gt;Jaeger&lt;/a&gt; as Istio addon.&lt;/p&gt;
&lt;h2 id=&#34;install-istio-using-kiali-source-code-option-ii&#34;&gt;Install Istio using Kiali source code (Option II)&lt;/h2&gt;
&lt;p&gt;For development purposes, if we have Kiali source code, we can use the kiali hack scripts:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;hack/istio/install-istio-via-istioctl.sh -c kubectl -a &amp;#34;prometheus grafana&amp;#34; -s values.meshConfig.defaultConfig.tracing.zipkin.address=&amp;#34;tempo-smm-distributor.tempo:9411&amp;#34;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;install-kiali-and-bookinfo-demo-with-some-traffic-generation&#34;&gt;Install Kiali and bookinfo demo with some traffic generation&lt;/h2&gt;
&lt;p&gt;Install kiali:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;helm install \
    --namespace istio-system \
    --set external_services.tracing.internal_url=http://tempo-smm-query-frontend.tempo:16685 \
    --set external_services.tracing.external_url=http://localhost:16686 \
    --set auth.strategy=anonymous \
    kiali-server \
    kiali/kiali-server
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Install bookinfo with traffic generator&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;curl -L -o install-bookinfo.sh https://raw.githubusercontent.com/kiali/kiali/master/hack/istio/install-bookinfo-demo.sh
chmod +x install-bookinfo.sh
./install-bookinfo.sh -c kubectl -tg -id ${ISTIO_DIR}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And access Kiali:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl port-forward svc/kiali 20001:20001 -n istio-system
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img src=&#34;https://v2-24.kiali.io/images/tutorial/tempo/kiali-tempo-traces.png&#34; alt=&#34;Kiali Tempo Traces&#34; title=&#34;Kiali Tempo traces&#34;&gt;&lt;/p&gt;

      </description>
    </item>
    
  </channel>
</rss>
