Commit bfbf1401 authored by Liz Fong-Jones's avatar Liz Fong-Jones
Browse files

Add CI + verify.sh, flesh out docs, fix 1e links and grammar accuracy

- verify.sh: one entry point to build/test every example, with tool-scoped
  targets (go/node/java/clickhouse/onee/all). Verified locally: all green.
- .gitlab-ci.yml: one job per toolchain, reusing verify.sh targets, so examples
  can't silently rot. (Authored to match local builds; not yet run on the
  project's runners.)
- chapter-14 run.sh: honor CLICKHOUSE_HOST to run against an external server
  (e.g. a CI service), skipping Docker — same source of truth for local + CI.
- 1e README: remove dead Gitpod/Glitch buttons pointing at the old standalone
  intro-to-o11y-go repo; document local run instead.
- chapter-11 bonus grammar: correct it against the real derived-column language
  (lowercase true/false/null) and document known divergences (infix operators,
  generic function names, IF-only root is an SLI convention). Still clearly
  labeled inferred, not authoritative.
- CONTRIBUTING.md / CODE_OF_CONDUCT.md: replace one-line stubs with real content.
- CONTRIBUTORS.md: credit the example authors actually used here — the book
  authors, the Chapter 14 ClickHouse team (Rory Crispin, Vlad Seliverstov,
  Xander Garbett, Dale McDiarmid), and the 1e workshop contributors.

Co-Authored-By: default avatarClaude Opus 4.8 (1M context) <noreply@anthropic.com>
parent 09b59a02
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+44 −0
Changes for .gitlab-ci.yml: 44 added lines, 0 removed lines.
Original line number Diff line number Diff line
# CI for the Observability Engineering examples. Each job runs one verify.sh
# target inside an image that has the matching toolchain, so the examples can't
# silently rot. The verify.sh script is the single source of truth, shared with
# local development (see CONTRIBUTING.md).
#
# Note: this pipeline is authored to match how the examples build locally, but
# hasn't been run against this project's GitLab runners — adjust images/tags or
# runner tags as needed for your instance.

stages:
  - verify

default:
  interruptible: true

go:
  stage: verify
  image: golang:1.24
  script:
    - ./verify.sh onee   # 1e OpenTelemetry workshop: vet + build
    - ./verify.sh go     # chapter-12 tests, chapter-15 gofmt/vet/build

node:
  stage: verify
  image: node:22
  script:
    - ./verify.sh node   # chapter-05 tests

java:
  stage: verify
  image: maven:3-eclipse-temurin-21
  script:
    - ./verify.sh java   # chapter-07 mvn clean compile

clickhouse:
  stage: verify
  image: clickhouse/clickhouse-server:24.8
  services:
    - name: clickhouse/clickhouse-server:24.8
      alias: clickhouse
  variables:
    CLICKHOUSE_HOST: clickhouse   # run.sh talks to the service, skips Docker
  script:
    - ./verify.sh clickhouse      # chapter-14 SQL examples
+6 −11
Changes for 1e/chapter-07-instrumentation-with-opentelemetry/README.md: 6 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -13,15 +13,12 @@ a whole microservice ecosystem with just one service!

## What to do

Recommended:
Clone this repository and run the app locally. We expect a recent Go toolchain
(1.24+) to be set up.

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/honeycombio/intro-to-o11y-go)

Alternative:

[Remix this app on Glitch](https://glitch.com/edit/#!/intro-to-o11y-go).

Alternative 2: Clone and run locally. If you use VSCode Devcontainers, this repository is set up for that. Otherwise, we expect golang to be set up.
> The original standalone edition of this workshop offered one-click Gitpod and
> Glitch environments. Those pointed at a separate repository that no longer
> hosts this code, so they've been removed; run it locally as described below.

### Start the App

@@ -29,9 +26,7 @@ Alternative 2: Clone and run locally. If you use VSCode Devcontainers, this repo

### See the App

In GitPod: while it's running, click "Remote Explorer" on the left sidebar; then expand "ports" and look for a "preview" button.

Locally: [http://localhost:3000](http://localhost:3000)
[http://localhost:3000](http://localhost:3000)

Activate the sequence of numbers by pushing **Go**. After you see numbers, push **Stop**. Try this a few times.

+19 −0
Changes for 2e/chapter-11-slos/bonus-grammar/README.md: 19 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -11,6 +11,25 @@ that grammar as an exercise. This directory fills it in.
> template for writing the grammar of *your* query language, then substitute your
> tool's actual functions and field syntax.

### Known divergences from the real derived-column language

So nobody is misled into thinking this is the literal Honeycomb grammar (these are
all visible in Honeycomb's public derived-column documentation):

- **Literals are lowercase**: `true`, `false`, `null` — not the uppercase
  TRUE/FALSE/NULL the book's prose uses to describe an SLI's three outcomes.
- **Comparisons and boolean logic are really infix operators** (`=`, `!=`, `<`,
  `<=`, `>`, `>=`, `!` for NOT, and infix `AND`/`OR`). This grammar uses the
  function forms (`EQUALS(...)`, `LT(...)`, `NOT(...)`) the book writes, and pins
  them to a small fixed set on purpose — a tighter grammar makes constrained
  decoding more reliable. The real language accepts arbitrary function names and
  the operator forms too.
- **Any expression is a valid derived column.** `root` is pinned to `IF()` here
  only because an SLI classifies each event; that's a convention, not a syntax
  rule.
- **Column names are richer** than `[a-zA-Z0-9_.]` (they allow more punctuation,
  plus quoted forms).

There are two distinct ways to give a model the grammar, and they compose:

1. **In the prompt** (soft constraint). Describe the grammar in the prompt text
+2 −2
Changes for 2e/chapter-11-slos/bonus-grammar/generate-sli-with-grammar.prompt.md: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -33,9 +33,9 @@ The expression must conform to the following grammar (EBNF):
    comparison  = compfn "(" operand "," operand ")" ;
    compfn      = "EQUALS" | "LT" | "LTE" | "GT" | "GTE" | "STARTS_WITH" | "CONTAINS" ;
    exists      = "EXISTS(" field ")" ;
    operand     = field | string | number | bool | "NULL" ;
    operand     = field | string | number | bool | "null" ;
    field       = "$" name ;                              (* e.g. $http.route *)
    bool        = "TRUE" | "FALSE" ;
    bool        = "true" | "false" ;                      (* lowercase literals *)

Use standard OpenTelemetry semantic convention field names (for example
`$http.route`, `$http.response.status_code`, `$http.request.method`,
+15 −4
Changes for 2e/chapter-11-slos/bonus-grammar/sli.gbnf: 15 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -3,8 +3,16 @@
# RECONSTRUCTED from the function and operator vocabulary shown in the book's
# examples (IF/AND/NOT/EQUALS/LT/LTE/STARTS_WITH/EXISTS/$field/...), with obvious
# siblings (OR/GT/GTE/CONTAINS) added by analogy. This is NOT Honeycomb's actual
# production grammar — the real one has more functions and different details.
# It's a stand-in for the grammar the book leaves as "fill in the blanks."
# production grammar, and it differs from it deliberately and incidentally:
#   - It is intentionally a SMALL, function-only SUBSET. Honeycomb's real
#     derived-column language also offers infix operators (= != < <= > >=, ! for
#     NOT, AND/OR), arithmetic, and a generic "any function name" rule rather
#     than the fixed set enumerated here. Constraining decoding to a known-good
#     subset is a feature, not a bug.
#   - root is pinned to IF() because an SLI classifies each event; a general
#     derived column can be any expression.
# Swap in your own tool's functions and field syntax. See your tool's public
# derived-column documentation for the authoritative grammar.
#
# GBNF (GGML BNF) is the grammar format used by llama.cpp — and therefore by
# runtimes built on it, such as Ollama — to constrain decoding. Passing a grammar
@@ -31,13 +39,16 @@ compfn ::= "EQUALS" | "LT" | "LTE" | "GT" | "GTE" | "STARTS_WITH" | "CONTAI

existsexpr  ::= "EXISTS(" ws field ws ")"

operand     ::= field | string | number | bool | "NULL"
operand     ::= field | string | number | bool | "null"

field       ::= "$" name
name        ::= [a-zA-Z_] [a-zA-Z0-9_.]*

string      ::= "\"" ( [^"\\] | "\\" . )* "\""
number      ::= "-"? [0-9]+ ( "." [0-9]+ )?
bool        ::= "TRUE" | "FALSE"

# Note: literals are lowercase in the real DSL (true / false / null), even though
# the book's prose describes the SLI's three outcomes as TRUE/FALSE/NULL.
bool        ::= "true" | "false"

ws          ::= [ \t\n]*
Loading