Skip to content

jpkrohling/otelcol-cookbook

Repository files navigation

🧑🏼‍🍳🍲 OpenTelemetry Collector Cookbook

This repository has a personal collection of OpenTelemetry Collector recipes curated by @jpkrohling.

📔 Recipes

Each directory in this repository is a recipe and has an appropriate readme file with instructions.

This repository grew organically based on tests that I needed to perform in order to verify a bug report, create an example configuration for a Grafana Labs customer, or prepare for a presentation. As such, quite a few recipes lack good descriptions and running instructions. Those recipes are found under "ratatouille".

🥢 Tools used

  • Custom Collector images from my collection of distributions. Anywhere a custom image is being used, you can use contrib if you prefer.
  • telemetrygen is used a lot in this repository to send telemetry data to our Collector instance
  • otelcol-contrib is used as well, both in binary format for local examples, and as container image in examples using Kubernetes
  • k3d is used in the Kubernetes recipes, in order to create a local Kubernetes cluster
  • OpenTelemetry Operator is used in most Kubernetes recipes. See the setup instructions below
  • kubens from the kubectx project

🍴 OpenTelemetry Operator

To get a working instance of the OpenTelemetry Operator, follow the official instructions from the project, but here's a quick summary of what's needed for our purposes:

k3d registry create dosedetelemetria ## note down the port, and add `k3d-dosedetelemetria` to your /etc/hosts
k3d cluster create --registry-use k3d-dosedetelemetria:40503 dosedetelemetria ## use the same port as the command above

kubectl apply -f https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml
kubectl wait --for=condition=Available deployments/cert-manager -n cert-manager

kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/latest/download/opentelemetry-operator.yaml
kubectl wait --for=condition=Available deployments/opentelemetry-operator-controller-manager -n opentelemetry-operator-system

🧰 LGTM

For some recipes, we are using Grafana's LGTM stack to visualize data. You can just start the container with the LGTM stack, or install the stack in your Kubernetes cluster. It's not recommended to use this container image in production.

Container

In this example, we are opening only the Grafana and OTel Collector's HTTP port, which is sufficient for our tests.

docker run -p 3000:3000 -p 4318:4318 --rm -d grafana/otel-lgtm

Kubernetes

kubectl create ns lgtm
kubens lgtm
kubectl apply -f _drawer/lgtm/lgtm.yaml
kubectl wait --for=condition=Available deployments/lgtm -n lgtm

🪳 Bugs

Did you find a bug? Is a recipe confusing, or not working at all? Please open an issue. Make sure to include:

  • the recipe name
  • the command you used to run the recipe
  • the version of the Collector you are using
  • what you expected to see
  • what you saw instead

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages