+3
−0
+27
−0
2e/chapter-05-structured-events/index.js
0 → 100644
+31
−0
+11
−0
+82
−0
Loading
Extract the substantive, runnable/copyable code from the 2nd edition into
2e/<chapter-NN-slug>/, each self-contained with its own README and toolchain:
- chapter-05-structured-events (JavaScript): the toy tracer that grows a
structured log into a trace span (log/logTiming/Span/AsyncLocalStorage).
node --test passes; npm start runs the demo.
- chapter-07-instrumenting-with-opentelemetry (Java/Maven): Example 7-1, W3C
trace-context inject/extract. Compiles and prints a live traceparent.
- chapter-12-slo-based-alerts (Go): the predictive burn-alert isBurnViolation,
with a table test reproducing the chapter's worked example (fires at 805
projected failures vs a 438 budget).
- chapter-14-clickhouse (SQL): Examples 14-1..14-6 + inline snippets, runnable
against ClickHouse in Docker via run.sh; 14-5 reproduces the book's exact
recovery times (nginx 961s, apiserver 63s).
- chapter-15-sampling (Go): the nine sampling strategies as separate compilable
programs, with teaching-simplifications corrected to build.
Only code a reader would copy/run is included; illustrative query-DSL snippets,
the git-diff in Example 20-1, and pseudo-code are intentionally omitted.
Add a top-level README indexing both editions and a generative-AI disclaimer
(examples authored by humans; GenAI used to maintain the repo).
Co-Authored-By:
Claude Opus 4.8 (1M context) <noreply@anthropic.com>
© 2026 O’Reilly Media, Inc. All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners. Terms of Service • Privacy Policy • Editorial Independence