CompCode Academy

Lesson 2 of 4 · Free to read

Exercises

Exercises — OpenTelemetry Collector Pipelines

Watch & learn

Course video

Open on YouTube
OpenTelemetry Collector on Kubernetes — Collector agent/gateway pattern on a cluster — receivers to exporters.

Course video

Open on YouTube
OpenTelemetry Deep Dive (Big Tent) — Standards, tracing, and why OTel is the 2026 vendor-neutral data plane.

Keep a lab notebook: hypothesis → command → result. Speed without evidence is not a skill.

How to use this file

  • Work Lab A → B → C on the same orders-lab repo
  • Prefer Docker Desktop; use Kind when the lab says so
  • Definition of Done at the bottom is the phase gate

Lab A — Canonical pipeline

Time: 45–60 min
Goal: One OTLP receiver fans out to Tempo/Loki/Mimir.

Setup

Phase 01 Collector config.

Steps

  1. Draw your current pipeline on paper.
  2. Add batch + memory_limiter processors.
  3. Verify all three signals still arrive.

Snippet — Minimal pipelines sketch

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [memory_limiter, batch]
      exporters: [otlp/tempo]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [prometheusremotewrite]
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/loki]

Success criteria

  • Pipeline diagram committed
  • Signals healthy after change

If stuck

Exporter failures often hide in Collector logs — check docker compose logs otel-collector.


Lab B — Redaction + OTTL

Time: 60 min
Goal: PII never reaches backends.

Setup

App emitting a sensitive attribute on purpose.

Steps

  1. Add attributes/filter processor to drop or hash PII keys.
  2. Send traffic and search Tempo/Loki for the raw value — must be absent.
  3. Document the redaction policy in TELEMETRY.md.

Success criteria

  • Raw PII not queryable
  • Policy doc exists

If stuck

Redact in the gateway so every agent path is covered.


Lab C — Tail sampling gateway

Time: 60–90 min
Goal: Keep errors/latency outliers; drop most successes.

Setup

Agent → gateway topology.

Steps

  1. Configure tail_sampling policies for status=ERROR and latency thresholds.
  2. Generate mixed success/error load.
  3. Compare Tempo volume before/after.

Success criteria

  • Error traces retained
  • Success volume clearly reduced

If stuck

Tail sampling needs enough wait time to see the full trace — tune decision_wait.


Stretch goals

  • Run Collector as gateway Deployment on Kind (preview of phase 05)

Definition of Done

  • Agent/gateway story explained in your own words
  • PII redaction proven
  • Tail sampling effect measured

Exercises — OpenTelemetry Collector Pipelines.

New free lessons and course updates. Unsubscribe from any email.