Semantic Web and Web 3.0 · class 07 · demo
Three signals, one request
The system of the class — gateway, orders, catalogue and payments — running inside this server. Send an order and follow it through the three signals: the trace says where the time went, the log lines say what happened, the metrics say how often and how fast for every request at once. The correlation id is what lets the three meet.
1. Send a request
2. The average hides the tail
The catalogue, GET /products/{id}, over the last 1 000 requests →
79.4 ms
average
26 ms
95th percentile
3.85 s
99th percentile
3. The raw signals
| /metrics | the counter and the histogram per route, in the Prometheus text format — what the collector exposes in the challenge |
| /logs | every log line kept, one JSON object per line; ?correlation=, ?service=, ?level= filter it |
| /health | for the server that publishes this page |
Latest traces
| Time (UTC) | Trace | Correlation | Status | Total | Where the time went |
|---|---|---|---|---|---|
| 13:16:27 | 39040ca8b55b53c8… | c-f8b1 | 201 | 469 ms | payments, 87% |
How it is built
| Signal | Here | From the class |
|---|---|---|
| Logging | log/slog in JSON, fixed messages, values in fields, log.Filter for the card number | examples/01-structured-logging |
| Correlation | X-Correlation, generated at the gateway, propagated by the HTTP client's transport | examples/02-correlation |
| Metrics | a counter and a histogram per route pattern, never per path | examples/03-metrics |
| Tracing | traceparent in and out, one span per service, written by hand | examples/04-tracing |
Time is simulated — nothing sleeps — so a thousand requests take milliseconds. Kept in memory: the last 50 traces (now 1), the last 2 000 log lines (now 19), the last 10 000 durations of each of the 5 series.