M. Kodirov

STAGE 08 / LESSON 03

Tracing with OpenTelemetry

OpenTelemetry provides tools and conventions for producing telemetry.

THE IDEA

Understand it.

A trace is made of spans that represent operations, such as handling an API request or calling a database. Context propagation connects related spans across process or service boundaries.

Instrumentation can be automatic, manual or a combination. Choose a backend to receive and analyze telemetry, and control sampling, sensitive attributes and the cost of collection.

SEE IT IN CONTEXT

A trace with nested spans

Trace: GET /tasks
  ├─ API request handler
  │   ├─ authorization check
  │   └─ PostgreSQL query
  └─ response serialization

This is a conceptual trace. Span timings can show where the request spent time, but you still need context to explain the cause.

LEARN FROM REAL WEBSITES

See it in the real world.

These simplified structures come from public sources. Company systems change, and the sources may describe only one project or an earlier design.

GitHub

GitHub engineering, 2021

Adopt a shared tracing standard

GitHub described adopting OpenTelemetry to make telemetry more consistent across infrastructure.

  1. Instrumented services
  2. OpenTelemetry tracing
  3. Connected investigation

What to learn: A common telemetry standard helps connect a request's work across systems; the linked article records the 2021 effort.

Read the source: GitHub OpenTelemetry adoption

Choice Hotels

AWS customer story, date not stated

Collect application telemetry

An AWS case study reports Choice Hotels using the AWS Distro for OpenTelemetry to collect traces and metrics.

  1. Application
  2. AWS Distro for OpenTelemetry
  3. Monitoring services

What to learn: Instrumentation produces telemetry that can be sent to monitoring systems. The case study is a vendor account of a particular deployment.

Read the source: Choice Hotels observability case study

TRY IT YOURSELF

Practice.

Why propagate trace context from the API to a worker?

Show one possible answer

It helps relate the worker’s operation to the originating request or job, making a multi-step flow easier to investigate.

GO DEEPER

Official references.