On this page
Repository layout
Link to the section Repository layoutlibo11y/
docs/ cross-language design contract, spec, and conventions
spec/ telemetry specification registry: the shared,
language-neutral source of truth
go/ Go modules (github.com/jamesainslie/libo11y/go and the
o11ygin, o11yconnect, and o11ysql submodules)
ts/ TypeScript workspace: Bun, the @libo11y/* packages
rust/ Rust workspace (planned)
java/ Java/Maven module (planned)
zig/ Zig package (planned)Each language directory is self-contained: its own build, tests, lint
configuration, changelog, and README. The spec/ registry is the shared,
language-neutral source of truth; each language generates typed constants
and validation tables from it.
Specification toolchain
Link to the section Specification toolchainThe specification is validated and generated by the repository’s own Go
tool (go/internal/specgen); the toolchain needs nothing beyond the Go
module itself. Make targets from the repository root:
make spec-checkdecodes the registry strictly and validates it against the libo11y policy suite: naming, namespace ownership, sensitivity and cardinality classification, references and tombstones, enums, event discipline, and metric naming/unit rules. Rule IDs are listed in SPEC.md, section 8.make spec-generatevalidates first, then regeneratesgo/spec,go/internal/spectables,docs/taxonomy,ts/packages/spec/src/generated, and the OpenTelemetry schema files underspec/schemasfrom the registry. An invalid registry generates nothing. Generated files are never edited by hand.make spec-driftfails if generated artifacts are stale or if the generator produced files git does not track. CI runs it, and a golden test ingo testcatches the same drift.
The upstream semantic-conventions release the registry extends is pinned
as semconv_version in spec/registry/manifest.yaml; referenced upstream
attributes are defined by that release and never redefined here.
TypeScript toolchain
Link to the section TypeScript toolchainThe TypeScript workspace in ts/ pins its toolchain exactly. It uses
bun@1.3.13 as the package manager and runtime, typescript@7.0.2,
@biomejs/biome@2.6.8 for linting and formatting, and @types/bun@1.4.4.
make ts-check installs the locked dependencies, then lints, typechecks
and tests every package. make ci runs it.
Versioning and releases
Link to the section Versioning and releases- Independent per-language versioning, path-prefixed tags:
go/v0.1.0,rust/v0.1.0. - Semantic versioning per language ecosystem norms.
- No lockstep releases across languages. A change to shared docs never forces a release.
- Each language keeps a
CHANGELOG.mdin Keep a Changelog format. - The Go family is four modules:
github.com/jamesainslie/libo11y/goand the submodulesgo/o11ygin,go/o11yconnectandgo/o11ysql. They release together at one version. A release tagsgo/vX.Y.Zfirst, thengo/o11ygin/vX.Y.Z,go/o11yconnect/vX.Y.Zandgo/o11ysql/vX.Y.Z, all on the same commit, and each submodule’sgo.modrequires the parent at that version.make release-checkvalidates the sequence forRELEASE_VERSION(defaultv0.2.0) against a throwaway local remote; it never touches real refs. The default always matches the version the submodules require, so it moves only in a release commit. - To release Go version X.Y.Z: move the changelog’s entries into a
## [X.Y.Z] - datesection, set each submodule’s requirement on the parent module tovX.Y.Z, setRELEASE_VERSIONin theMakefileand the default inscripts/release-check.shtovX.Y.Z, and runmake release-checkon the commit to release. Then push the tags, all on that commit, in two pushes:go/vX.Y.Zon its own, then the three submodule tags. Never push all four together, because GitHub creates no push events when more than three tags are pushed at once. Each tag starts the release workflow (.github/workflows/release.yml). It checks that the version is semantic, that a submodule tag’s parent tag exists on the same commit and matches itsgo.modrequirement, and that the changelog has the section, then runs vet, the tests, and the spec gates. It publishes a GitHub Release whose notes are that changelog section (scripts/release-notes.sh, readinggo/CHANGELOG.md, which covers all four modules), marked as a prerelease only for versions with a-prereleasesuffix, and requests the version fromproxy.golang.organd builds a consumer against it. - TypeScript releases are lockstep. Every
@libo11y/*package publishes at one shared version from ats/vX.Y.Ztag, starting withts/v0.1.0. Until then@libo11y/specis private at version0.0.0, and nothing publishes it. - The specification versions separately: once released, each version has a
spec/vX.Y.Ztag and a schema file served at its schema URL. Spec 1.0.0 is taggedspec/v1.0.0on thego/v0.1.0commit. Before tagging,make schema-publishedconfirms the schema URL serves the generated file byte for byte. See SPEC.md, section 7.
- The user-facing package/crate/artifact is named
o11ywhere the ecosystem allows (Go packageo11y, Rust cratelibo11y, Java artifactlibo11y). - Metric and attribute names emitted on behalf of applications come from
OpenTelemetry semantic conventions at the pinned version, with no vendor
prefix. The library’s own telemetry (the
o11y.schema.violationsmetric, registered events,o11y.config.*startup attributes) uses theo11y.*namespace, which only the spec registry may mint. - The semconv pin is recorded per language release and upgraded deliberately. Current pin: semconv v1.41.0.
Environment variables
Link to the section Environment variablesStandard OTEL_* variables are the only environment surface. libo11y defines
no LIBO11Y_* variables for anything OTEL specifies. If a knob has no OTEL
equivalent it is a code-level option, not an environment variable, until the
OTEL specification catches up.
Commit messages
Link to the section Commit messages<area>: <type>: <description> all lowercase, where area is one of go,
ts, spec, rust, java, zig, docs, general, and type follows
Conventional Commits (feat, fix, docs, refactor, test, chore,
build, ci, perf, revert) or names a Keep a Changelog category
(change, removed).
Example: go: feat: add o11ytest recorder harness
Quality gates
Link to the section Quality gatesmake ci runs every gate locally, and .github/workflows/ci.yml runs the
same gates on pushes to main and on pull requests (Go 1.26.x, split into
parallel jobs). Every CI job calls the Makefile target except lint, which
runs the same golangci-lint version (v2.12.2) through
golangci/golangci-lint-action on each module. Keep the two in step when
adding a gate.
| Target | Gate |
|---|---|
make lint |
golangci-lint v2 (with gofumpt) on every Go module, zero issues; golangci-lint fmt applies the formatter |
make vet |
go vet on every Go module |
make test |
go test -race on every Go module (GO_TEST_P sets package parallelism), including the testing/slogtest handler contract, the OTLP wire tests, and the generator’s golden test |
make tidy-check |
each module’s go.mod and go.sum tidy on its own (GOWORK=off) |
make spec-check, make spec-drift |
registry policy checks and generated-artifact drift |
make release-check |
the Go release sequence (needs a clean tree) |
make vuln |
govulncheck on every Go module; runs last because it depends on the advisory database and the toolchain’s patch level |
- Go: the gates above. Standard-library advisories are fixed by the
toolchain, not the module: build with go1.26.9 or later on the 1.26 line
(or go1.27.2 or later on the 1.27 line), or
make vulnreports them. - Rust (planned): clippy pedantic,
unsafe_code = "forbid", cargo-deny. - Java (planned): errorprone, spotless.
- Zig (planned): zig fmt, exhaustive switch on error sets.
Source: docs/CONVENTIONS.md at 23fbb21