This topic describes how to install an OpenTelemetry Collector in Kubernetes to collect infrastructure and application metrics and send them to Lightstep. To simplify the configuration of the OpenTelemetry Collector, a StatefulSet is used with the Target Allocator’s PrometheusCRD functionality enabled. This behavior allows the Collector to dynamically discover new jobs.
- Local install of Helm.
- A Lightstep access token.
- The OpenTelemetry Operator and Cert Manager running in your cluster.
From the Lightstep otel-collector-charts repository, copy the
kube-otel-stackfolder to your existing directory.
- Set the shell variable
LS_TOKENto your Lightstep access token.
Disable any Kubernetes Infrastructure Components you do not need
By default, the
kube-otel-stackhas the following components enabled for scraping:
You can disable any of them by setting
- Install the chart using the
1 2 3 4
kubectl create namespace opentelemetry kubectl create secret generic otel-collector-secret -n opentelemetry --from-literal=LS_TOKEN=$LS_TOKEN helm dependency update helm upgrade lightstep ./charts/kube-otel-stack -f ./charts/kube-otel-stack/values.yaml -n opentelemetry --install
- Verify that the StatefulSet Collector is up and running, You should see three pods in “ready” state in the namespace.
kubectl get statefulset -n opentelemetry
Now that you are succesfully scraping Collector, Operator, Target Allocator, and Kubernetes infrastructure metrics, you can use our pre-built dashboards to monitor them. Or you can use the terraform dashboards. If in the future you have applications that emit Prometheus metrics, you can use ServiceMonitors and PodMonitors to scrape them.