Lesson 2 of 4 · Free to read
Exercises
Exercises — OpenTelemetry Collector Pipelines
Watch & learn
Course video
Course video
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-labrepo - 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
- Draw your current pipeline on paper.
- Add batch + memory_limiter processors.
- 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
- Add attributes/filter processor to drop or hash PII keys.
- Send traffic and search Tempo/Loki for the raw value — must be absent.
- 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
- Configure tail_sampling policies for status=ERROR and latency thresholds.
- Generate mixed success/error load.
- 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.