Skip to content

Latest commit

 

History

History
82 lines (53 loc) · 2.91 KB

File metadata and controls

82 lines (53 loc) · 2.91 KB

OpenTelemetry metrics on Kubernetes tutorial

Welcome to the OpenTelemetry metrics on Kubernetes tutorial! This tutorial is continuation of KubeCon EU 2023 OpenTelemetry on Kubernetes tutorial. Today we will focus on collecting metrics on Kubernetes with OpenTelemetry. We will use OpenTelemetry API/SDK, collector, operator and auto-instrumentation libraries.

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

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.20.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 --image kindest/node:v1.27.3

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.27.3

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

Deploy OpenTelemetry operator

kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/download/v0.88.0/opentelemetry-operator.yaml

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-na-2023-opentelemetry-kubernetes-metrics-tutorial/main/backend/01-backend.yaml

Afterwards, the backend can be found in the namespace observability-backend. A grafana dashboard with preconfigured datasources and dashboard is available for visualisation and can be made accessible with port-fowarding.

kubectl port-forward -n observability-backend svc/grafana 3000:3000

Open it in the browser localhost:3000