Welcome to the OpenTelemetry distributed tracing on Kubernetes tutorial! This tutorial is continuation of:
- KubeCon NA 2023 OpenTelemetry metrics on Kubernetes tutorial.
- KubeCon EU 2023 OpenTelemetry on Kubernetes tutorial.
Today we will focus on distributed tracing. The tutorial will cover using OpenTelemetry instrumentation, API/SDK, collector and deploying the stack on Kubernetes. The readmes cover also more advanced topics (collecting traces from Kubernetes, tracing with service meshes) that can be done offline.
See the agenda
Almost all the following steps in this tutorial require kubectl. Your used version should not differ more than +-1 from the used cluster version. Please follow this installation guide.
If go is installed on your machine, kind
can be easily installed as follows:
go install sigs.k8s.io/[email protected]
If this is not the case, simply download the kind-v0.22.0 binary from the release page. (Other versions will probably work too. 🤠)
After a successful installation, a cluster can be created as follows:
kind create cluster --name=workshop --config=kind-1.29.yaml
Kind automatically sets the kube context to the created workshop cluster. We can easily check this by getting information about our nodes.
kubectl get nodes
Expected is the following:
NAME STATUS ROLES AGE VERSION
workshop-control-plane Ready control-plane 75s v1.29.1
kind delete cluster --name=workshop
cert-manager is used by OpenTelemetry operator to provision TLS certificates for admission webhooks.
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.11.0/cert-manager.yaml
kubectl get pods -n cert-manager -w
kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/download/v0.94.0/opentelemetry-operator.yaml
kubectl get pods -n opentelemetry-operator-system -w
This course is all about Observabilty, so a backend is needed. If you don't have one, you can install Prometheus for metrics and Jaeger for traces as follows:
kubectl apply -f https://raw.githubusercontent.com/pavolloffay/kubecon-eu-2024-opentelemetry-kubernetes-tracing-tutorial/main/backend/01-backend.yaml
kubectl get pods -n observability-backend -w
Afterwards, the backend can be found in the namespace observability-backend
.
kubectl port-forward -n observability-backend service/jaeger-query 16686:16686
Open it in the browser localhost:16686