Skip to content

Latest commit

 

History

History
93 lines (61 loc) · 3.33 KB

File metadata and controls

93 lines (61 loc) · 3.33 KB

OpenTelemetry distributed tracing on Kubernetes tutorial

Welcome to the OpenTelemetry distributed tracing on Kubernetes tutorial! This tutorial is continuation of:

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

Setup infrastructure

Kubectl

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.

Kind

Kind Quickstart.

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. 🤠)

Create a workshop cluster

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

Cleanup

kind delete cluster --name=workshop

Deploy initial services

Deploy cert-manager

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 

Deploy OpenTelemetry operator

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  

Deploy observability backend

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


Next steps