Inteli Logo

Module 8 · Information Systems · Lesson 10 · Lab

OpenTelemetry and the closed loop

This page reproduces, in the browser, the session in which a coding agent makes the DataApp of Lesson 7 observable and then controls it. Four prompts add the three signals (metrics in Prometheus, traces in Tempo and structured logs in Loki, sent through an OpenTelemetry collector), bring up the stack that reads them, and write a controller that compares the indicators with their objectives and acts on the DataApp. The tabs below the editor are the screens of that stack: the path of each signal through OpenTelemetry, the metrics and the alerts, the waterfall of each trace, the log lines linked to its spans, the ticks of the closed loop, the tests and a load test of the processing. Nothing runs here: the files are those of the repository, and every run, trace, log line, metric, alert and test was recorded on 12/11/2026 from the real stack, in Docker.

metricsnumbers of each run, pushed; the warehouse, scrapedstep 01
▶
traces · logsOpenTelemetry: spans of run, task, request and SQL; JSON lines with their idsstep 02
▶
collector · stackPrometheus, Tempo, Loki and Grafana, linked by run_id, trace_id and span_idstep 03
▶
closed loopSLI − SLO → decide → act, within guardrails, and a person when it cannotstep 04
Observe metrics say that something changed, traces say where, logs say why · Correlate alert → trace → failing span → its log lines · Control the loop closes only when something compares with the objective and acts
Steps Speed
lesson_10_observability — Welcomesimulation
⎇ mainstep —UTF-8

What is real and what is simulated

The files of the editor are those of lab/lesson-10/, over the package of Lesson 7; cli.py and config.py appear in step 01 already in their final form, with the command and the settings of the loop of step 04. The runs, the traces read from Tempo, the alerts, rules and series read from Prometheus, the log lines, the ticks of the controller, the tests and the load test were recorded on 12/11/2026 by build_lab_data.py, with the six containers of stack/ in Docker. Step 01 replays the good run without the lines that steps 02 and 03 add (the trace and the push). The agent and its messages are a staging of the session.

How to use it in class

  • Open OpenTelemetry first: it shows the API, the SDK, the collector and the stores, and lights up as the steps build them.
  • After step 03, follow the path of the person on call: the alert in Metrics · alerts, its trace in Traces, the failing span, then “Logs for this span”.
  • In step 04, Closed loop shows each tick of the two rehearsals, and Load answers how far the SLO of duration holds.

Doing it for real

The README of lab/lesson-10/ lists the commands. Over a copy of the package of Lesson 7, the four prompts of prompts/ go to the coding agent in this order; docker compose up -d in stack/ brings up Prometheus on 9090, the Pushgateway on 9091, the collector on 4317 and 4318, Tempo on 3200, Loki on 3100 and Grafana on 3000. The reference passes its 25 tests without network. Prompt 05 is the work of the second hour, over the DataApp of each group.

Prompt

Prompt
Section