CompCode Academy

Lesson 2 of 4 · Free to read

Exercises

Exercises — Distributed Tracing & TraceQL

Watch & learn

Course video

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

Course video

Open on YouTube
How Prometheus Monitoring works — Prometheus scrape, TSDB, and alert architecture used in MNCs.

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 — SpanKinds + attributes

Time: 45–60 min
Goal: Waterfall shows SERVER/CLIENT/CONSUMER/INTERNAL correctly.

Setup

OTel SDK on api and worker.

Steps

  1. Review auto-instrumented spans for Express and AWS SDK.
  2. Add one business INTERNAL span for validation.
  3. Verify semantic convention attributes (http.route, messaging.system).

Success criteria

  • Kinds look correct in Tempo UI

If stuck

Wrong kind usually means manual span started with defaults — set kind explicitly.


Lab B — Async propagation

Time: 60–90 min
Goal: One trace_id across api → worker → S3.

Setup

SNS→SQS pipeline from phase 01.

Steps

  1. Confirm propagator injects into SNS/SQS attributes.
  2. Worker extracts context before processing.
  3. Break propagation on purpose, observe two traces, then fix.

Success criteria

  • Single trace spans the async hop

If stuck

Request MessageAttributeNames: ['All'] on receive.


Lab C — TraceQL mastery

Time: 45–60 min
Goal: Attribute + structural queries return real traces.

Setup

Sampled traces in Tempo.

Steps

  1. Run an attribute filter for http.status_code = 500.
  2. Run a structural query for descendant errors under /orders.
  3. Document sampling rate and its effect on empty results.

Snippet — TraceQL example

{ resource.service.name = "api" && name = "POST /orders" } >> { status = error }

Success criteria

  • Two TraceQL queries saved in README
  • Sampling caveat written

If stuck

Empty results? Check sampler and time range first.


Stretch goals

  • Enable service graph metrics and open the Grafana service map

Definition of Done

  • Async hop stays in one trace
  • You can explain sampling vs “no data”
  • At least one structural TraceQL query works

Exercises — Distributed Tracing & TraceQL.

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