Pull requests / #1816
#1816 Opt-in OTLP traces of every /v1 request (0.1.41), plus the docs pages 0.1.41 left uncovered
open · @Buddychek · 0 comentários · No GitHub
Setup & installServer & APIAMD / HIPModels & quantsDocumentationLinux
Descrição
## Title
Opt-in OTLP traces of every /v1 request (0.1.41), plus the docs pages 0.1.41 left uncovered
Issue: Resolves #
## Summary
Adds the opt-in OTLP tracing that 0.1.41 shipped in `serve/` as a tested, documented feature, and covers the 0.1.41 behaviors no page documented: one trace per `/v1` request exported as OTLP/HTTP JSON, the switches no page listed, the watchdog/body-cap/batch-groups behaviors, the AMD/Linux card order, and the markdown hygiene around them. Off by default: with no endpoint set, the request path is byte-identical to the release build.
## What changed
**serve/tracing.py (new)** — one OpenTelemetry trace per request, built from the seconds the Monitor already measures (queue, load, prefill, decode) and exported as OTLP/HTTP JSON on its own thread, so a down collector never blocks a request. A client `traceparent` becomes the root span's parent; every answer carries its own `traceparent`. With tracing on and the monitor off, timings and token counts only — no prompt or answer text reaches a collector. OTLP/HTTP is written as JSON by hand: tracing adds no package to the install. Enable with `--trace-otlp`, `"trace_otlp"` in the run config, or `$STRATA_TRACE_OTLP` ("default" = http://localhost:4318/v1/traces).
**serve/server.py, serve/runconfig.py** — the tracing hooks in the request path (begin/finish, the answer's traceparent header, trace-only records with the monitor off) and the runconfig endpoint validation with the same check the server applies at start.
**serve/test_tracing.py (new, 9 tests)** — collector stand-in, per-request span tree, W3C context both ways, dead-collector survival, endpoint precedence (CLI > config > env), off-by-default. 9/9 pass.
**CMakeLists.txt, sycl/CMakeLists.txt** — pin CMP0169 OLD around the FetchContent of strata_llamacpp (CMake 3.30 deprecates FetchContent_Populate(<name>); CMake 4.4 warns every configure), guarded so CMake < 3.30 still configures.
**docs/** — DETAILS.md: the tracing section and the 0.1.41 switches no page listed, card order on AMD/Linux (KFD topology SIMDs x clock), STRATA_DUMP_FIRST_LOGITS next to the research hooks, markdown hygiene (spaced table delimiters, fenced code with a language, the tier figure as a markdown image). TROUBLESHOOTING.md: the tracing row, the watchdog/body-cap/batch-groups behaviors, the gcc/glibc row in the table's two-column shape. BATCHING.md, MULTI_GPU.md, SECOND_GPU.md: the batch-groups and card-order rows they were missing.
## Extra Notes
Tested on Python 3.15 (venv), no GPU: serve.test_tracing 9/9; serve.test_server + test_monitor + test_runconfig + test_request_accounting 297/297; all together 306/306 on this branch's base (fb58e0d). Tracing is opt-in and the default path is untouched. Not tested: the CMake pins on a CMake < 3.30 machine (the guard is by reading; the 3.30+ warning path is seen on every configure of this build), and the OTLP collector round-trip against a real Jaeger/Tempo.
No site
Links install, modelos, releases.