[PR #1816] [CLOSED] Opt-in OTLP traces of every /v1 request (0.1.41), plus the docs pages 0.1.41 left uncovered #3694

Closed
opened 2026-11-07 15:30:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1816
Author: @Buddychek
Created: 10/10/2026
Status: ❌ Closed

Base: main ← Head: pr/0.1.41-otel-traces


📝 Commits (10+)

  • dff0d0b docs: the 0.1.41 switches that no page listed
  • 6fe21f7 docs: markdown hygiene in DETAILS.md - spaced table delimiters, code fences with a language, the tier figure as a markdown image
  • 1921dbd docs: the 0.1.41 watchdog, body-cap and batch-groups behaviors no page had
  • d16611b docs: the three new troubleshooting rows match the table's two columns
  • 74b1cf6 docs: card order on AMD/Linux too (KFD topology SIMDs x clock); STRATA_DUMP_FIRST_LOGITS next to the research hooks
  • 63bf830 serve: opt-in OTLP traces of every /v1 request; CMake CMP0169 pin
  • a28f334 docs: the 0.1.41 opt-in OTLP tracing no page covered; markdown hygiene
  • e468ef2 docs: markdown hygiene in the staged rows; .gitignore for .history and .github/agents
  • ba3b504 serve: make the OTLP tracing tests run; fix the three bugs they then found
  • 6440a5c docs: the 0.1.41 tracing clamp, root-span parent and shutdown drain no page had

📊 Changes

12 files changed (+948 additions, -113 deletions)

View changed files

📝 CMakeLists.txt (+7 -0)
📝 SECURITY.md (+5 -0)
📝 docs/BATCHING.md (+6 -5)
📝 docs/DETAILS.md (+131 -18)
📝 docs/MULTI_GPU.md (+15 -71)
📝 docs/SECOND_GPU.md (+21 -0)
📝 docs/TROUBLESHOOTING.md (+15 -0)
📝 serve/runconfig.py (+11 -0)
📝 serve/server.py (+51 -19)
➕ serve/test_tracing.py (+353 -0)
➕ serve/tracing.py (+326 -0)
📝 sycl/CMakeLists.txt (+7 -0)

📄 Description

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(); 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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1816 **Author:** [@Buddychek](https://github.com/Buddychek) **Created:** 10/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/0.1.41-otel-traces` --- ### 📝 Commits (10+) - [`dff0d0b`](https://github.com/Niko1221/Strata/commit/dff0d0be886ab0af9425fce37102b2ca903c2388) docs: the 0.1.41 switches that no page listed - [`6fe21f7`](https://github.com/Niko1221/Strata/commit/6fe21f7928a12d21955404b5350063a6ff3b9532) docs: markdown hygiene in DETAILS.md - spaced table delimiters, code fences with a language, the tier figure as a markdown image - [`1921dbd`](https://github.com/Niko1221/Strata/commit/1921dbdbf4ad23142f9d07f56bd9500792048f8d) docs: the 0.1.41 watchdog, body-cap and batch-groups behaviors no page had - [`d16611b`](https://github.com/Niko1221/Strata/commit/d16611b02c579beb54bbea844445d49d773811d6) docs: the three new troubleshooting rows match the table's two columns - [`74b1cf6`](https://github.com/Niko1221/Strata/commit/74b1cf6c2f2927dce8f14d2663966981ba131c87) docs: card order on AMD/Linux too (KFD topology SIMDs x clock); STRATA_DUMP_FIRST_LOGITS next to the research hooks - [`63bf830`](https://github.com/Niko1221/Strata/commit/63bf8307b93a1bb3abfd04bd12089161fc7eed68) serve: opt-in OTLP traces of every /v1 request; CMake CMP0169 pin - [`a28f334`](https://github.com/Niko1221/Strata/commit/a28f33430596a681602bada409303606494e25e8) docs: the 0.1.41 opt-in OTLP tracing no page covered; markdown hygiene - [`e468ef2`](https://github.com/Niko1221/Strata/commit/e468ef2467dec5a249a566fd104bf7445867a836) docs: markdown hygiene in the staged rows; .gitignore for .history and .github/agents - [`ba3b504`](https://github.com/Niko1221/Strata/commit/ba3b504d96767362897fdb66c2b33f6097bfc345) serve: make the OTLP tracing tests run; fix the three bugs they then found - [`6440a5c`](https://github.com/Niko1221/Strata/commit/6440a5c01e7ad9a9c9295799c1c3c452d999df0b) docs: the 0.1.41 tracing clamp, root-span parent and shutdown drain no page had ### 📊 Changes **12 files changed** (+948 additions, -113 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+7 -0) 📝 `SECURITY.md` (+5 -0) 📝 `docs/BATCHING.md` (+6 -5) 📝 `docs/DETAILS.md` (+131 -18) 📝 `docs/MULTI_GPU.md` (+15 -71) 📝 `docs/SECOND_GPU.md` (+21 -0) 📝 `docs/TROUBLESHOOTING.md` (+15 -0) 📝 `serve/runconfig.py` (+11 -0) 📝 `serve/server.py` (+51 -19) ➕ `serve/test_tracing.py` (+353 -0) ➕ `serve/tracing.py` (+326 -0) 📝 `sycl/CMakeLists.txt` (+7 -0) </details> ### 📄 Description ## 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:30:06 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3694
No description provided.